[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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



On Sat, Nov 19, 2005 at 11:33:44PM +0100, Petter Reinholdtsen wrote:
>[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.  :)

I'm not quite sure what the initial rationale was, although Adam Heath
suggested on IRC that it could be to allow scripts to set environment
variables which would propagate through to subsequent scripts.

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

Yes, I saw CONCURRENCY in /etc/init.d/rc.  Not quite sure how that's
supposed to work with a value of "shell".  I presume that startpar
is/will be a helper function/script that interprets the LSB
"Required-Start" pseudo header?

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

It won't currently, but will if the patch is applied.

  $ grep -lw exit /etc/rcS.d/*.sh | wc -l
  12

--bod



Reply to: