On Thu, 14 Jul 2011, Roland Kammerer wrote:

> Last week I sent a small patch (~10 lines) for /etc/rc to robert@ that
> would allow to prefix daemons in rc_scripts with an '@' and then these
> prefixed daemons would be started in background. For example:
> rc_scripts="foo @bar baz". bar would be started to background.
> 
> robert replied that starting to background is already implemented and I
> should use rc_bg=YES in the individual rc scripts. Then I asked him if
> he thinks that this is really the "right" design decision, but I did not
> get any answer.
> 
> Just to be sure: I don't blame robert in any way for not replaying,
> but I am really curious why you guys took that design decision.

Because rc_bg is only use for daemons that cannot fork into the 
background. It's not there to speed up boot or anything.

> The rest is more or less the mail I wrote to robert:
> 
> Thanks for clearing that up, my fault. Do you really think it is the
> right design decision? I think we can agree that it is more or less
> impossible for the daemon package maintainer to decide if it is always
> safe to start the daemon in background. Maybe there are other daemons
> that depend on it, or maybe not. Therefore it is a decision that has to
> be taken by the admin of the system and system by system.

Irrelevant. daemons should never use rc_bg, except when they are not 
capable of forking into the background.

> Now imagine you install daemons "a", "b", "c", and "d". Then you have to
> edit rc_scripts and bring them in the right order. Then you decide from
> that, that it is safe to start those without a dependency in the
> background. Then you have to edit all these rc scripts and set rc_bg to
> YES.  Now imagine on a reboot something goes wrong. You have to check
> rc_scripts (where you do not see which daemons were started in
> background) and then you have to take a look at all of the individual rc
> scripts if the daemon was started in background as this might be the
> cause of the problem.
> 
> With the current solution there is no single point where you get the
> whole picture, it is cluttered around rc_scripts and the individual rc
> scripts.
> 
> I think with the proposed solution you have a single point, namely
> rc_scripts where you get the whole picture and you have a single point
> to edit/change the order and the starting-to-background behaviour.
> 
> Did I miss something important here?

Yes, you see rc_bg as something that it's not. It is a necessary hack, 
nothing else and should NOT be used unless forced to.
Also you didn't see the whole picture, because @foobar would not work 
with base rc scripts because they don't use pkg_scripts to start.

-- 
Antoine

Reply via email to