Package: lsb
Version: 2.0-1

If an attempt is made to use install_initd to add a startup script which has a blank 'Default-Stop' header it will fail. For example, `make install` from the Hewlett-Packard Linux Imaging and Printing Project aborts with the following:

# /usr/lib/lsb/install_initd hplip
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 | sNN kNN]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
                -n: not really
                -f: force


The info section for /etc/init.d/hplip is as follows: ### BEGIN INIT INFO # Provides: hplip # Required-Start: # Required-Stop: # Default-Start: 3 5 # Default-Stop: # Description: Start/stop script for HP Linux Imaging and Printing (HPLIP) ### END INIT INFO


This causes the install_initd script to execute the following (syntatically invalid) command:
/usr/sbin/update-rc.d hplip start 20 2 3 4 5 . stop 20 .



This problem can be rectified using the following patch:

138c138,141
< os.system("/usr/sbin/update-rc.d %(initfile)s start %(startpri)d %(start_runlevels)s . stop %(stoppri)d %(stop_runlevels)s ." % locals())
---
> cmd = "/usr/sbin/update-rc.d %(initfile)s start %(startpri)d %(start_runlevels)s ."
> if len(defstop) > 0:
> cmd += " stop %(stoppri)d %(stop_runlevels)s ."
> os.system(cmd % locals())



Perhaps a better solution would be to modify the 'get' function in /usr/lib/lsb/initdutils.py to not clobber the provided defaults if the second argument is blank, i.e.:
defstop = headers.get('Default-Stop', defstop)
returns the initial value of defstop if the Default-Stop header is blank. I don't know whether or not this is the intended behaviour.


Daniel Burr


-- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Reply via email to