mfsbsd
mfsbsd copied to clipboard
installed package's rc scripts don't get run
Hi Martin,
If one of the optional packages put in the packages directory installs a startup script into /usr/local/etc/rc.d then it doesn't get run at mfsbsd boot time because rcorder runs before the rc.d/package script gets to mount /usr/local and install the packages.
A semi-decent workaround is to have another file in scripts called something like localpackages that runs near the end of the rc.d scripts and runs the stuff in /usr/local/etc/rc.d. It may not be quite right in the handling if it should honor the .sh thing for not running in a subshell. Maybe there's a shell function for that, I'm not super expert on FreeBSD initialization.
!/bin/sh
$Id$
PROVIDE: localpackages
REQUIRE: LOGIN
KEYWORD: FreeBSD
. /etc/rc.subr
name="localpackages" start_cmd="localpackages_start" stop_cmd=":"
localpackages_start() { for file in /usr/local/etc/rc.d/* do echo $file start sh $file start done }
load_rc_config $name run_rc_command "$1" adsb (master) scripts $
Yes, I will look at this when I have some more time.
btw. this should work in ROOTHACK mode