openrc-discuss

Re: Calling /sbin/rc during boot

Roy Marples

Wed Dec 03 08:23:38 2008

On Wed, 2008-12-03 at 05:52 +0000, Renato Alves wrote:
> 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.

Glad you like it :)

> 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.

It's never been a defined, nor supported behaviour to call "rc
<runlevel>" whilst rc itself is running. OpenRC now enforces this I
think.

Instead, what we provide is a mechanism to override the level we enter
after the boot runlevel has finished. What I mean is this - the system
boots OpenRC like so

rc sysinit
rc boot
rc default

The first call must happen and cannot be changed. The second call is
optional, but is still present on all Gentoo systems. For this to work
it needs to be there.

In the boot runlevel a script should then call
rc --override default_battery

BTW, if that works, you should open a Gentoo bug so that they can fix
the script.

> 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?

Do you see the same issue with the above?

Thanks

Roy

Attachment: signature.asc
Description: This is a digitally signed message part


Follow-Ups:
Re: Calling /sbin/rc during bootRenato Alves
Re: Calling /sbin/rc during bootRenato Alves
References:
Calling /sbin/rc during bootRenato Alves
Archive administrator: postmaster@marples.name