Dan Purgert wrote:
> Ken Dibble wrote:
> > # 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 -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 believe that it's on purpose, because the operator has created a state
> where dnsmasq cannot conceivably start (it's uninstalled), and yet has
> left an init script that tries to bring it up.
>
> If there were any scripts relying on this one to come up cleanly, they
> wouldn't start.
Correct. Because files in /etc are automatically "conffiles" and
conffiles are left in place when a package is "removed" but not
"purged". A "purge" will remove the conffile too.
I recommend installing "etckeeper" with git and then always "purge"ing
packages rather than only "remove"ing them. This is safe with
etckeeper installed because then conffiles are always stored and
available from the git version control repository if needed again
later.
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 following will purge and remove those conffiles.
apt-get purge dnsmasq dnsmasq-base
List packages that are installed but removed leaving conffiles behind.
I recommend cleaning these up. Especially if you have a lot of them.
Especially before a major release upgrade because they get in the way
over time as they collect up.
dpkg -l | grep ^rc
Bob