Your message dated Mon, 15 Oct 2012 18:29:35 +0100
with message-id <[email protected]>
and subject line Re: Bug#690314: /etc/init.d/rc may execute S##<name> or
K##<name> scripts twice if <name> starts with upper case characters
has caused the Debian Bug report #690314,
regarding /etc/init.d/rc may execute S##<name> or K##<name> scripts twice if
<name> starts with upper case characters
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
690314: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=690314
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: sysv-rc
Version: 2.86.ds1-61
/etc/init.d/rc may execute S##<name> or K##<name> scripts twice
if <name> starts with upper case characters.
/etc/init.d/rc execution loop works in principle as follows:
generate alphabetically ordered list of all S* or K* files in the rc*.d
directory
set current level number to empty string
for all files in list:
remove leading S or K from file name
remove trailing <name> fom file name
compare resulting ## number with current level number
if numbers do not match
set current level number to resulting ## number
generate list of all files matching S##.* (or K##.*
respectively)
execute all script file found by the name pattern
matching
fi
rof
However, the script seems not to properly recognize and truncate <name>
parts starting with upper case letters.
So, if one defines a start script like S99Tomcat
the script does not only extract the number part 99 but also the upper
case character(s) setting level number to 99T
Would s.o. name a script S99TOMCAT the resulting level number would be
S99TOMCAT
This alone does not produce an error, because the script does match the
pattern S##.* (with ## being S99TOMCAT) and will be executed.
But for the case that another script with same level number exists,
S99TOMCAT will be executed twice.
e.g: two scripts: S99TOMCAT and S99apache.
for S99apache the resulting level number is 99.
the loop then executes all scripts matching the pattern S99.*, which is
s99apache and S99TOMCAT.
for S99TOMCAT the resulting level number is 99TOMCAT, which does not
match the curren level number 99.
As a result the rc script handles 99TOMCAT like another level number and
executes all scripts matching S99TOMCAT.* - and starts therefore
S99TOMCAT for the second time.
--- End Message ---
--- Begin Message ---
Version: 2.86.ds1-63
On Mon, Oct 15, 2012 at 06:35:14PM +0200, Reichel, Philip wrote:
> Hello,
> thank you for your quick answer,
>
> I have the following logic in my rc script:
>
> level=${s#/etc/rc$runlevel.d/S}
> level=${level%%[a-z]*}
>
> which explains the error on my machine (not entirely the same logic as
> you used below).
>
> I extracted and checked the package contents of
> sysv-rc_2.86.ds1-61_all.deb to be absolutely sure that no one has
> modified the rc script file in the meantime, and there is still the same
> logic as mentioned above.
>
> If bug fixing is not possible or is necessary any more, I am fine with
> that after knowing why.
> I just wanted the bug to be posted in case s.o. else has the same
> problems and searches the bug archive for a possible explanation.
I've checked the git history, and this was fixed in 2.86.ds1-63.
I think I checked the wrong version yesterday (-64); it's definitely
broken in oldstable, and fixed in stable, testing and unstable.
Thanks,
Roger
--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' schroot and sbuild http://alioth.debian.org/projects/buildd-tools
`- GPG Public Key F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800
--- End Message ---
_______________________________________________
Pkg-sysvinit-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-sysvinit-devel