Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 560288 - sys-apps/openrc: dependency ordering fails when affected init script is not added to the runlevel
Summary: sys-apps/openrc: dependency ordering fails when affected init script is not a...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-12 15:49 UTC by Lars Wendler (Polynomial-C) (RETIRED)
Modified: 2016-05-02 16:44 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2015-09-12 15:49:56 UTC
Hi,

I might have found a bug in the dependency calculation part of openrc.
It seems like in some situations openrc ignores the rc_before and rc_after settings:

I have xdm init script with rc_need="consolekit" and it's added to default runlevel.
I have virtualbox-guest-additions with rc_before="xdm" and rc_after="consolekit" and also added to the default runlevel.
I have consolekit with rc_before="virtualbox-guest-additions" but it's _not_ added to any runlevel but gets pulled into the dependency graph by rc_need from xdm.

virtualbox-guest-additions still gets started before consolekit which breaks startup of consolekit daemon.


As you might have guessed already this happens in a Gentoo VM inside of a VirtualBox host.
The problem is, that the virtualbox-guest-additions init script starts vboxguest-service which (since virtualbox-4.2.6) starts consolekit and polkit daemons if not being invoked with the --disable-vminfo switch.

Of course I could fix this imediately by adding consolekit init script to the default runlevel but IMHO openrc should be able to solve this anyway because it has all the necessary information to get the dependency order right.
Comment 1 nobody 2015-09-13 13:14:08 UTC
There's no bug there Poynomial-C, it's expect.

Have a look: https://wiki.gentoo.org/wiki/Handbook:X86/Working/Initscripts
When using before, then the given script is launched before the selected one <if the selected one is part of the init level>. So an init script xdm that defines before alsasound will start before the alsasound script, but <only if alsasound is scheduled to start as well in the same init level>. <If alsasound is not scheduled to start too, then this particular setting has no effect> and xdm will be started when the init system deems it most appropriate.

Similarly, after informs ...<if the selected one is part of the init level>. <If not, then the setting has no effect> and the script will be launched by the init system when it deems it most appropriate.

So without them sharing same level (your consolekit share none as it is not in any runlevels), both keywords do nothing.
While i understand the concern it "should" maybe do like you said, still "it's not a bug, but a feature" (c)Bill Gates :)
On the other end, while i myself could enjoy such feature, seeing how portage is resolving deps itself, i just prefer openrc keeping this "simple" scheme and not going into a deps hell calculation when starting an init script ; KISS
Comment 2 Benda Xu gentoo-dev 2015-11-10 09:46:05 UTC
I think `nobody` is correct.

Lars, if you add consolekit to the run level, the services will start in the right order.  Otherwise, replace "after" with "need".
Comment 3 William Hubbs gentoo-dev 2016-05-02 16:14:41 UTC
Since there has been no more activity on this bug, I am closing it and
agreeing with @heroxdb.

If this change in behaviour is important to you, please feel free to
submit a patch.

Thanks,

William
Comment 4 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2016-05-02 16:44:45 UTC
So you're going the easy way by ignoring useful feature requests. Good to know...