On 04/04/16 17:13, Thilo Six wrote:
> Simon Kelley schrieb/wrote:
>>
>> The following code in /etc/init.d/dnsmasq is responsible for this
>> behaviour.
>>
>> # /etc/dnsmasq.d/README is a non-conffile installed by the dnsmasq
>> package.
>> # Should the dnsmasq package be removed, the following test ensures that
>> # the daemon is no longer started, even if the dnsmasq-base package is
>> # still in place.
>> test -e /etc/dnsmasq.d/README || exit 0
> 
> for the purpose you described this line can be dropped completely IMHO.
> The following line in the init script already has:
> 
> test -x $DAEMON || exit 0
> 
> so when the dnsmasq package is removed but not purged the init script already
> exits zero.
> 
> 
> 
> kind regards,
> 
>      Thilo
> 

It's not that simple, unfortunately. There are actually _two_ dnsmasq
packages, dnsmasq, and dnsmasq-base. Dnsmasq-base provides the binary
and documentation, and is depended on by various things like
networkmanager. The dnsmasq package provides the system-started daemon.

The problem that this code is trying to solve is the case when both
packages are installed, then just dnsmasq is removed. At this point
dnsmasq should not be started at boot time, but the binary still exists
(since dnsmasq-base is still installed.)

That explains why the code looks at /etc/dnsmasq.d/README since that's
installed by the dnsmasq package and isn't a conffile. SO when the
dnsmasq package is removed /etc/dnsmasq.d/README is removed.

Any suggestions for a cleaner approach gratefully accepted......



Cheers,

Simon.

Attachment: 0xE19135A2.asc
Description: application/pgp-keys

Reply via email to