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

2005-11-19 Thread Brendan O'Dea
Package: sysv-rc Version: 2.86.ds1-5 Severity: serious 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". This could p

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

2005-11-19 Thread Petter Reinholdtsen
[Brendan O'Dea] > 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. I'm not sure why it is documented in policy, but the sysv-rc implementat

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

2005-11-20 Thread Thomas Hood
Brendan O'Dea wrote: > 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. Disconfirmation: $ cat /tmp/s #!/bin/bash echo foo return echo bar [EMAIL PROTECTED]:~/src/sysvinit/pkg-sysvinit

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

2005-11-21 Thread Thomas Hood
Brendan O'Dea wrote: > there are quite a few instances in /etc/init.d/*.sh scripts where "exit" is > called. All the exit commands are either (1) at the end of usage exception sections, or (2) preceded by colons ':'. Testing suggests that a ": exit 0" does the same as ":", namely, nothing. Miqu

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

2005-11-21 Thread Brendan O'Dea
On Mon, Nov 21, 2005 at 09:55:22AM +0100, Thomas Hood wrote: >Brendan O'Dea wrote: >> there are quite a few instances in /etc/init.d/*.sh scripts where "exit" is >> called. > >All the exit commands are either (1) at the end of usage exception sections, >or (2) preceded by colons ':'. Testing sugge

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

2005-11-21 Thread Brendan O'Dea
On Mon, Nov 21, 2005 at 09:34:11AM +0100, Thomas Hood wrote: >Brendan O'Dea wrote: >> 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. > > >Disconfirmation: > >$ cat /tmp/s >#!/bin/bash

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

2005-11-19 Thread Petter Reinholdtsen
[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.

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

2005-11-19 Thread Brendan O'Dea
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

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

2005-11-19 Thread Steve Langasek
On Sat, Nov 19, 2005 at 11:33:44PM +0100, Petter Reinholdtsen wrote: > >"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 thin

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

2005-11-19 Thread Petter Reinholdtsen
[Steve Langasek] > It's perfectly sensible: if the scripts were meant to be run in > parallel, they shouldn't have the ".sh" extension... Eh, are you claiming that policy mention sourcing of .sh scripts to make sure those scripts are not run in paralell? It does not sounds reasonable to me, as th

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

2005-11-20 Thread Petter Reinholdtsen
[Petter Reinholdtsen] > The patch look good, but will be equivalent to a forked subprocess > when running the scripts in parallel. Here is a possible patch to avoid running .sh scripts in the background when using CONCURRENCY=shell. Index: debian/sysv-rc/etc/init.d/rc

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

2005-11-20 Thread Steve Langasek
On Sun, Nov 20, 2005 at 08:20:59AM +0100, Petter Reinholdtsen wrote: > [Steve Langasek] > > It's perfectly sensible: if the scripts were meant to be run in > > parallel, they shouldn't have the ".sh" extension... > Eh, are you claiming that policy mention sourcing of .sh scripts to > make sure tho

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

2005-11-21 Thread Petter Reinholdtsen
I'm not sure how this could happen, but when I enabled sourcing of the .sh scripts in rcS.d/, the boot failed because /etc/rcS.d/S01glibc.sh uses 'exit 0' at the end of the script, and thus terminates the S runlevel. This script was added in glibc version 2.3.5-5 uploaded 2005-08-27. The strange