Ken Dibble wrote: > > Since this is Debian Policy the init script must handle appropriately
> > the case where the package has been "removed" removing non-conffiles
> > of the package but not "purged" leaving the conffiles in /etc which
> > includes the init script.
>
> This is exactly my point. Not starting is the correct thing to do.
> Reporting no error when an error occurred is not the right thing to
> do.
What error occurred? As far as I can see no error has occurred.
> Any script attempting to call the dsnsmasq script fails, because the
> dsnmasq script returns no error even though an error occurred.
What error occurred?
> I don't know how I can be any more descriptive than this.
I see no error here. Other than an operational error. If one wants
dnsmasq to be running then it must be installed. If one wants to
remove but not purge dnsmasq then that will leave the
/etc/init.d/dnsmasq file behind because that's the way it works.
That's the way it has worked in Debian since decades. That is not an
error. That is in the design of the way conffiles are handled.
If one then calls "/etc/init.d/dnsmasq start", or the more
pedantically correct "service dnsmasq start" (or using invoke-rc.d),
then that will do nothing as per Policy in order to accomodate that
the package was removed and not purged.
If you actually want the /etc/init.d/dnsmasq file to be gone then the
package must be purged. If that is what you wanted then that was
where the error crept into the process. The package was mistakenly
removed in error instead of having been purged. That would be the
root cause of the error. Fix it by purging.
By the report so far the error was in removing the package rather than
purging it. Purge it instead if that is what you want.
> Repeating part of my original message:
> # 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 not an error. This is the correct behavior.
> 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.
No error has been made.
> 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)
This would break everyone else who relies upon the established
behavior. I would be immediately reporting such a thing as a grave
bug.
The /etc/init.d files are a conffiles. You may edit those files as
you desire and change their behavior on your own systems. I often do
this. You are allowed to establish your own behaviors that are as you
like them to be on your system. It's your system and therefore your
rules. Go wild! But do not break it for the rest of us! We are
using the system too.