Bug#339955: [Pkg-sysvinit-devel] Bug#339955: sysv-rc: /etc/init.d/*.sh should be sourced in runlevel S

Petter Reinholdtsen pere at hungry.com
Sat Nov 19 22:33:44 UTC 2005


[Brendan O'Dea]
> Debian Policy states (§9.3.1):
> 
>    "Also, if the script name ends `.sh', the script will be sourced
>    in runlevel `S' rather that being run in a forked subprocess, but
>    will be explicitly run by `sh' in all other runlevels".

What a strange thing for policy to specify.  :)

This will make it impossible to speed up the rcS.d boot by running
scripts in parallel.  It does not sound sensible to me.

> This could probably be achieved with the attached patch, although
> there are quite a few instances in /etc/init.d/*.sh scripts where
> "exit" is called.  These scripts need to be changed to use "return"*
> appropriately before the behaviour is changed.

Well, I would be surprised if any of the scripts used in rcS.d uses
exit, as this would break the boot.

The patch look good, but will be equivalent to a forked subprocess
when running the scripts in parallel.

> Note: I believe that "return" should work to exit from a script both
> when sourced and when executed but perhaps someone with a copy of
> POSIX could confirm.

As far as I know, return will exit the script if used in the 'outer'
scope.




More information about the Pkg-sysvinit-devel mailing list