[Pkg-sysvinit-devel] Bug#690314: /etc/init.d/rc may execute S##<name> or K##<name> scripts twice if <name> starts with upper case characters

Roger Leigh rleigh at codelibre.net
Sun Oct 14 11:22:50 UTC 2012


On Fri, Oct 12, 2012 at 02:28:00PM +0200, Reichel, Philip wrote:
> Package: sysv-rc
> Version: 2.86.ds1-61

The version of sysv-rc above is in oldstable.  While the
current version still contains the same logic, we now use
startpar for booting so that this logic is only ever run
if the upgrade to insserv booting is not yet completed;
it will be removed entirely in wheezy+1.

The logic is this:

	level=${s#/etc/rc$runlevel.d/S}
	level=${level%%[a-zA-Z]*}

But I'm afraid that running it by hand appears to work fine:

% /bin/sh
$ s=/etc/rc2.d/S99Tomcat
$ runlevel=2
$ level=${s#/etc/rc$runlevel.d/S}
$ echo $level
99Tomcat
$ level=${level%%[a-zA-Z]*}
$ echo $level
99

This is with dash as /bin/sh, testing on unstable.  Maybe a bug in
the shell you're using in oldstable?

In terms of fixing the bug, if this is indeed reproducible, we can't
fix anything in oldstable at this point--it's no longer supported.
I would advise upgrading to 6.0 "squeeze", which has security
support and periodic point releases, if possible.  It's certainly
not reproducible on later releases with the limited testing I have
given it, and 6.0 and later use startpar for booting, so the
above codepath will no longer be used in any case.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.



More information about the Pkg-sysvinit-devel mailing list