Stuart Henderson [s...@spacehopper.org] wrote: > > Alternatively I think it would work to add "!/etc/rc.d/unbound start" > to a suitable hostname.if file, though that's a bit of a hack and this > seems like a useful additioto use an alternative > syslogd which is another good candidate for starting early) .
This is slightly better for the unbound use case, keeps from adding another line of text at startup, and still works fine if you were going to usurp syslogd with an early script as well. --- /etc/rc Fri Dec 9 10:13:53 2011 +++ rc Thu Jan 5 01:00:21 2012 @@ -232,6 +232,9 @@ if [ X"$1" = X"shutdown" ]; then dd if=/dev/arandom of=/var/db/host.random bs=65536 count=1 >/dev/null 2>&1 chmod 600 /var/db/host.random >/dev/null 2>&1 + if [ -n "${pkg_early_scripts}" ]; then + pkg_scripts="${pkg_scripts} ${pkg_early_scripts}" + fi local _c=$? if [ ${_c} -eq 0 -a -n "${pkg_scripts}" ]; then echo -n 'stopping package daemons:' @@ -396,7 +399,14 @@ make_keys echo -n 'starting early daemons:' -start_daemon syslogd ldattach pflogd named nsd ntpd isakmpd iked sasyncd +start_daemon syslogd +# Run rc.d(8) early scripts from packages +if [ -n "${pkg_early_scripts}" ]; then + for _r in $pkg_early_scripts; do + [ -x /etc/rc.d/${_r} ] && start_daemon ${_r} + done +fi +start_daemon ldattach pflogd named nsd ntpd isakmpd iked sasyncd start_daemon ldapd echo '.'