diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-03-14 20:45:26 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-03-14 21:07:08 +0100 |
commit | d63e3f0cc0a3d3a20e1a39b67b4ae6fcdfafec48 (patch) | |
tree | 77d17896c7f5bff1f15f5ea96f828fc1fe4f6016 /main/dnsmasq/dnsmasq.initd | |
parent | 27b1481c2bb1394613f25acdc29241fdff707efd (diff) | |
download | aports-d63e3f0cc0a3d3a20e1a39b67b4ae6fcdfafec48.tar.bz2 aports-d63e3f0cc0a3d3a20e1a39b67b4ae6fcdfafec48.tar.xz |
main/dnsmasq: improve runscript, check config before starting
Diffstat (limited to 'main/dnsmasq/dnsmasq.initd')
-rw-r--r-- | main/dnsmasq/dnsmasq.initd | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/main/dnsmasq/dnsmasq.initd b/main/dnsmasq/dnsmasq.initd index 4e035c2dd9..c92853416d 100644 --- a/main/dnsmasq/dnsmasq.initd +++ b/main/dnsmasq/dnsmasq.initd @@ -2,6 +2,9 @@ description="A lightweight DNS, DHCP, RA, TFTP and PXE server" +extra_commands="checkconfig" +description_checkconfig="Check configuration syntax" + extra_started_commands="reload" description_reload="Clear cache and reload hosts files" @@ -19,11 +22,21 @@ depend() { } start_pre() { + $command --test 2>/dev/null || $command --test || return 1 checkpath -m 0644 -o dnsmasq:dnsmasq -f /var/lib/misc/dnsmasq.leases } reload() { - ebegin "Reloading $SVCNAME" - kill -HUP "$(cat $pidfile)" + ebegin "Reloading $RC_SVCNAME" + + start_pre || return 1 + start-stop-daemon --signal HUP --pidfile "$pidfile" + eend $? +} + +checkconfig() { + ebegin "Checking $RC_SVCNAME configuration" + + $command --test eend $? } |