disabling dnsmasq in /etc/default/dnsmaq disables init.d script
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dnsmasq (Ubuntu) |
Fix Released
|
Low
|
Thierry Carrez |
Bug Description
Binary package hint: dnsmasq
Ubuntu 8.04, package dnsmasq
Setting "ENABLED=0" in /etc/default/dnsmaq to prevent dnsmasq from starting at next boot time completely disables the /etc/init.d/dnsmasq script. That script contains the line
test "$ENABLED" != "0" || exit 0
near its beginning and therefore never evaluates its start/stop/restart parameter.
I don't think this is the intended/expected behavior. Example:
I wanted to stop dnsmasq on my box and keep it deactivated on further reboots because I introduced a new dhcp server to my network. Not seeing any reason for a special order I first set ENABLED=0 and then did "sudo /etc/init.d/dnsmasq stop". After getting wrongly assigned ip adresses I rechecked and found the dnsmasq process still running. To stop it (the "official" way) I had to set ENABLED=1 again.
In my opinion, disabling the starting of a daemon should not prevent the user from stopping an already running instance.
description: | updated |
According to the comment in the file ("Whether or not to run the dnsmasq daemon; set to 0 to disable"), ENABLED should control if the dnsmasq daemon is run at startup, not if the init script is totally disabled, so I tend to agree with the reporter.
In particular, running "/etc/init. d/dnsmasq status" would always return 0 if ENABLED=0... and that means "started".