The dnsmasq init.d script fails to give the correct result code under
certain conditions if it cannot be started.
for reference:
line 119
start()
{
line 123
# 0 if daemon started
# 1 if daemon was already running
# 2 if daemon could not be started
...
...
}
but
line 35
# The following test ensures the dnsmasq service is not started, when the
# package 'dnsmasq' is removed but not purged, even if the dnsmasq-base
# package is still in place.
test -e /usr/share/dnsmasq/installed-marker || exit 0
test -x ${DAEMON} || exit 0
This is inconsistent with the documentation in start() and one could
certainly make the case that returning
no error when an error has occurred is a bad thing.
I would suggest something like this:
test -e /usr/share/dnsmasq/installed-marker || (log_daemon_msg start
"installed-marker not present" && exit 2)
test -x ${DAEMON} || ( log_daemon_msg start "${DAEMON} not executable"
&& exit 2)