#!/usr/bin/execlineb -P
# preload in foreground (-f), matching debian/sv/preload.
# -l '' sends logging to the s6 pipeline instead of a file.
# OPTIONS / DAEMON_OPTS from /etc/default/preload (OpenRC).

envfile -I /etc/default/preload
importas -sCuD "" DAEMON_OPTS DAEMON_OPTS
importas -sCuD "" OPTIONS OPTIONS
envfile -I /etc/s6-rc/config/preload.conf
importas -sCuD "-s /var/lib/preload/preload.state -f -l ''" Args Args

foreground { mkdir -p /var/lib/preload }

fdmove -c 2 1
exec /usr/sbin/preload ${Args} ${DAEMON_OPTS} ${OPTIONS}
