[Pkg-nagios-devel] Bug#721704: pnp4nagios-bin: init script exits 0 when it should exit 3 with unconfigured service

Joerg Jaspert joerg at debian.org
Tue Sep 3 09:41:20 UTC 2013


Package: pnp4nagios-bin
Severity: normal

Dear Maintainer,

the pnp4nagios-bin init script contains the following lines:

# Check if RUN is set to "yes" in /etc/defaults/npcd
if [ "x$RUN" != "xyes" ] ; then
        echo "$NAME has been disabled in /etc/default/npcd."
        exit 0
fi

While its debatable to do this via default/ file, I'm on the side
of "yeah, ok". What I dislike is the exit 0. Which is wrong.

The LSB defines values for initscripts to give back, 
see

http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

and 0 is defined "program is running or service is OK".
Which it definitely isn't in the case above.

It defines some more, and the most useful return code in this case seems to be
3, "program is not running". Alternatively 4, status unknown, but meh, it is known
here.

Even if one leaves LSB outside and uses common sense, a 0 doesn't seem to
be right for a default value as delivered by the package.

--
bye Joerg



More information about the Pkg-nagios-devel mailing list