killproc routine removes PID file even if HUP is sent to process.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lsb (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: lsb-base
Whilst looking in to a bug with nagios2 (see bug #174466), I think there is a bug in the killproc() sub-routine within /lib/lsb/
killproc -p $THEPIDFILE $DAEMON 1
This causes an issue because the PID file is removed, even though a HUP is sent to the process and as a result, a future reload (e.g. /etc/init.d/nagios2 reload) causes two daemons to be spawned because the PID file has been removed so the daemon's init script believes the daemon has stopped.
Package: lsb-base
Priority: required
Section: misc
Installed-Size: 76
Maintainer: Ubuntu Core Developers <email address hidden>
Original-
Architecture: all
Source: lsb
Version: 3.1-23.1ubuntu3
Replaces: lsb-core (<< 2.0-6), lsb (<< 2.0-6)
Depends: sed, ncurses-bin
Conflicts: lsb-core (<< 2.0-6), lsb (<< 2.0-6)
Filename: pool/main/
Size: 20176
MD5sum: cfcd198d912a3ac
SHA1: 2dd7a35b92fb105
SHA256: 3c3fc72e2eb258f
Description: Linux Standard Base 3.1 init script functionality
The Linux Standard Base (http://
core system that third-party applications written for Linux can
depend upon.
.
This package only includes the init-functions shell library, which
may be used by other packages' initialization scripts for console
logging and other purposes.
Bugs: mailto:<email address hidden>
Origin: Ubuntu
This was noted in gusty. Other releases have not been tested or checked.
Attached is a patch that (for me) corrects the above problem in killproc() from /lib/lsb/ init-functions. It checks to see what signal type was sent. If the signal type is 1 (HUP), it does not remove the PID file.