Bind9 init script reports unknown status when named is stopped
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bind9 (Ubuntu) |
Triaged
|
Low
|
Unassigned |
Bug Description
Binary package hint: bind9
ProblemType: Bug
Architecture: amd64
Date: Mon Aug 9 15:05:38 2010
Dependencies:
adduser 3.112ubuntu1
base-files 5.0.0ubuntu20.
base-passwd 3.5.22
bind9utils 1:9.7.0.dfsg.P1-1
coreutils 7.4-2ubuntu2
debconf 1.5.28ubuntu4
debconf-i18n 1.5.28ubuntu4
debianutils 3.2.2
dpkg 1.15.5.6ubuntu4.1
findutils 4.4.2-1ubuntu1
gcc-4.4-base 4.4.3-4ubuntu5
libacl1 2.2.49-2
libattr1 1:2.4.44-1
libbind9-60 1:9.7.0.dfsg.P1-1
libc-bin 2.11.1-0ubuntu7.2
libc6 2.11.1-0ubuntu7.2
libcap2 1:2.17-2ubuntu1
libcomerr2 1.41.11-1ubuntu2
libdb4.8 4.8.24-1ubuntu1
libdns64 1:9.7.0.dfsg.P1-1
libgcc1 1:4.4.3-4ubuntu5
libgcrypt11 1.4.4-5ubuntu2
libgeoip1 1.4.6.dfsg-17
libgnutls26 2.8.5-2
libgpg-error0 1.6-1ubuntu2
libgssapi-krb5-2 1.8.1+dfsg-
libisc60 1:9.7.0.dfsg.P1-1
libisccc60 1:9.7.0.dfsg.P1-1
libisccfg60 1:9.7.0.dfsg.P1-1
libk5crypto3 1.8.1+dfsg-
libkeyutils1 1.2-12
libkrb5-3 1.8.1+dfsg-
libkrb5support0 1.8.1+dfsg-
libldap-2.4-2 2.4.21-0ubuntu5
liblocale-
liblwres60 1:9.7.0.dfsg.P1-1
libncurses5 5.7+20090803-
libpam-modules 1.1.1-2ubuntu5
libpam0g 1.1.1-2ubuntu5
libsasl2-2 2.1.23.
libselinux1 2.0.89-4
libssl0.9.8 0.9.8k-7ubuntu8
libstdc++6 4.4.3-4ubuntu5
libtasn1-3 2.4-1
libtext-
libtext-iconv-perl 1.7-2
libtext-
libxml2 2.7.6.dfsg-1ubuntu1
lsb-base 4.0-0ubuntu8
lzma 4.43-14ubuntu2
ncurses-bin 5.7+20090803-
net-tools 1.60-23ubuntu2
netbase 4.35ubuntu3
passwd 1:4.1.4.2-1ubuntu2
perl-base 5.10.1-8ubuntu2
sed 4.2.1-6
sensible-utils 0.0.1ubuntu3
tzdata 2010j-0ubuntu0.
zlib1g 1:1.2.3.
DistroRelease: Ubuntu 10.04
InstallationMedia: Ubuntu-Server 10.04 LTS "Lucid Lynx" - Release amd64 (20100427)
Package: bind9 1:9.7.0.dfsg.P1-1 [modified: usr/share/
PackageArchitec
ProcEnviron:
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcVersionSign
SourcePackage: bind9
Tags: lucid
Uname: Linux 2.6.32-21-server x86_64
Symptom:
When named is stopped, the "/etc/init.d/bnid9 status" command always returns 4 (unknown) instead of the correct 3 (stopped) status code. The cause of this behavior is the missing pid file, for the lsb scripts try to check the status by reading the process id from the pid file, and when this is missing they report unknown status.
The status check code from the init script:
---
status)
ret=0
status_of_proc -p ${PIDFILE} /usr/sbin/named bind9 2>/dev/null || ret=$?
exit $ret
;;
---
The following workaround restored correct behavior:
---
status)
ret=0
if [ -f ${PIDFILE} ]; then
status_of_proc -p ${PIDFILE} /usr/sbin/named bind9 2>/dev/null || ret=$?
else
status_of_proc /usr/sbin/named bind9 2>/dev/null || ret=$?
fi
exit $ret
;;
---
Thanks for the workaround, it will be considered for maverick.
chuck