update-rc.d: Use of uninitialized value

Bug #312764 reported by Jason Oster
6
Affects Status Importance Assigned to Milestone
sysvinit (Debian)
Fix Released
Unknown
sysvinit (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: sysv-rc

osterj@CN212409:~$ update-rc.d -n udev start 00 0
Use of uninitialized value $level in string ne at /usr/sbin/update-rc.d line 243.
Use of uninitialized value $level in pattern match (m//) at /usr/sbin/update-rc.d line 244.
update-rc.d: error: expected runlevel [0-9S] (did you forget "." ?)
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | SS KK]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
  -n: not really
  -f: force

The script works as it is supposed to, except for the Perl errors reported. (The list of run-levels is not terminated by a period.)

Related branches

Revision history for this message
Jason Oster (parasyte) wrote :
Revision history for this message
petski (petski) wrote :

The documentation is a bit unclear about this, but you should end your command with a "." (dot). The dot is mandatory:

pet@workmate$ update-rc.d -n mysql start 99 1 2 3 .
System startup links for /etc/init.d/mysql already exist.

pet@workmate$ update-rc.d -n mysql start 99 1 2 3
Use of uninitialized value $level in string ne at update-rc.d line etc etc

I agree that the script doesn't handle it very well when the final dot is missing. This should be fixed. I suggest the patch which I attached to this bug (diff against 2.86.ds1-61ubuntu1 jaunty)

I'll create a debdiff shortly and ask someone to sponsor it into jaunty. Afterwards, I'll inform the Debian guys.

petski (petski)
Changed in sysvinit:
status: New → Confirmed
Revision history for this message
Jason Oster (parasyte) wrote :

That patch looks even better! Thanks.

Revision history for this message
petski (petski) wrote :

Please sponsor attached patch into jaunty

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

There is a patch for this in Debian, how does your patch differ from that we'd get by merging again?

Revision history for this message
petski (petski) wrote :

I'm sorry Scott, but I don't see the patch in Debian. Could you give me directions please?

http://packages.debian.org/changelogs/pool/main/s/sysvinit/sysvinit_2.86.ds1-61/changelog

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

debdiff uploaded

Changed in sysvinit:
status: Confirmed → Fix Released
Changed in sysvinit:
status: Unknown → Fix Committed
petski (petski)
Changed in sysvinit (Debian):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.