Calling /sbin/rc during boot
Renato Alves
Wed Dec 03 05:52:47 2008
Hi everyone,
I've just migrated to baselayout2 and with it OpenRC 0.3.0 . So far I'm very
pleased with the change since most of the issues I had are now fixed or no
longer a problem.
Till now I noticed two strange/buggy behaviors, one related to calling
/sbin/rc from boot and the second to inconsistent logging.
I found the /sbin/rc problem while updating the pmg_switch_runlevel.sh
script that is on the power management guide. This script runs perfectly
when I plug in/out the AC connector and even when I issue a
"/etc/init.d/local restart".
However this same script doesn't work at boot time.
I managed to pinpoint the line that doesn't work and this is "/sbin/rc
<runlevel>" where <runlevel> is the desired change.
To test this behavior I added "/sbin/rc default" to local_start() and reboot
the kernel with the extra "softlevel=default_battery" parameter. The boot
goes fine but the runlevel change is ignored, running "rc-status --runlevel"
will give "default_battery" and not "default" as expected.
Then about the logging inconsistency. This seems related to the previous
issue.
If you activate rc.log and reboot (using the softlevel argument) you will
notice that the "default_battery" runlevel is referred to as "default" in
the logs (which is odd since "rc-status --runlevel" gives
"default_battery").
Still, if you force the runlevel with "/sbin/rc default_battery" in
local_start() you will get the ignored behavior (while on boot), you will
see a "default_battery" entry in the logs and all the runlevel references
should be correct from now on.
The log problem is a minor issue and not that relevant, however the first
one got me stuck... I've no idea how to workaround this. Any suggestions?
Renato
Archive administrator: postmaster@marples.name