Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#612906: Allow "/etc/init.d/dnsmasq reload"

6 views
Skip to first unread message

Anselm Lingnau

unread,
Feb 11, 2011, 9:10:03 AM2/11/11
to
Subject: Allow "/etc/init.d/dnsmasq reload"
Package: dnsmasq
Version: 2.55-2
Severity: wishlist
Tags: patch

According to the man page, dnsmasq listens to SIGHUP and will reload its
configuration files when the signal is received. It is common to enable the
"reload" action in init scripts to send SIGHUP to a daemon; however, the
Debian init script for dnsmasq does not appear to offer this.

-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dnsmasq depends on:
ii adduser 3.112+nmu2 add and remove users and groups
ii dnsmasq-base 2.55-2 A small caching DNS proxy and
DHCP
ii netbase 4.45 Basic TCP/IP networking system

dnsmasq recommends no packages.

Versions of packages dnsmasq suggests:
ii resolvconf 1.48 name server information handler

-- Configuration Files:
/etc/dnsmasq.conf changed [not included]

-- no debconf information

Here's a patch that adds the functionality in question:

--- /etc/init.d/dnsmasq 2010-06-02 21:07:10.000000000 +0200
+++ /etc/init.d/dnsmasq.new 2011-02-11 14:46:59.000000000 +0100
@@ -246,6 +246,16 @@
;;
esac
;;
+ reload)
+ if [ -f /var/run/dnsmasq/$NAME.pid ]; then
+ log_action_begin_msg "Reloading dnsmasq configuration"
+ if kill -HUP `cat /var/run/dnsmasq/$NAME.pid`; then
+ log_action_end_msg 0
+ else
+ log_action_end_msg 1
+ fi
+ fi
+ ;;
status)
log_daemon_msg "Checking $DESC" "$NAME"
status

--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Simon Kelley

unread,
Feb 11, 2011, 10:00:02 AM2/11/11
to
Anselm Lingnau wrote:
> Subject: Allow "/etc/init.d/dnsmasq reload"
> Package: dnsmasq
> Version: 2.55-2
> Severity: wishlist
> Tags: patch
>
> According to the man page, dnsmasq listens to SIGHUP and will reload its
> configuration files when the signal is received. It is common to enable the
> "reload" action in init scripts to send SIGHUP to a daemon; however, the
> Debian init script for dnsmasq does not appear to offer this.
>

From 'man dnsmasq':

When it receives a SIGHUP, dnsmasq clears its cache and then
re-loads /etc/hosts and /etc/ethers and any file given by
--dhcp-hostsfile, --dhcp-optsfile or --addn-hosts. The dhcp
lease change script is called for all existing DHCP leases. If
--no-poll is set SIGHUP also re-reads /etc/resolv.conf.
SIGHUP does NOT re-read the configuration file.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Whilst it might be useful to have "reload" operation which does reload
/etc/hosts, /etc/ethers etc it's not possible to do that without
violating the Debian-policy, which says:

"reload
cause the configuration of the service to be reloaded without
actually stopping and restarting the service."

It also causes confusion: people expect that that

/etc/init.d/dnsmasq reload

will reload the configuration, and it doesn't.


This functionality was present in long-ago versions of the dnsmasq
package and was removed after bugs which were the precise mirror-image
of this one were filed.

Cheers,

Simon.

0 new messages