diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2016-07-28 15:48:08 +0200 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2016-08-02 11:54:33 +0200 |
commit | 50d3f9a02bd5f9c4c442d65dd0bf673be249ad26 (patch) | |
tree | 013526c39a40ab01547ad3c605ff2cf3c8896ab5 /main/dnsmasq/dnsmasq.initd | |
parent | 93f50b4d264972d167f4b050b2f8a87d0826a145 (diff) | |
download | aports-50d3f9a02bd5f9c4c442d65dd0bf673be249ad26.tar.bz2 aports-50d3f9a02bd5f9c4c442d65dd0bf673be249ad26.tar.xz |
main/dnsmasq: improve runscript and abuild, enable conf-dir
Diffstat (limited to 'main/dnsmasq/dnsmasq.initd')
-rw-r--r-- | main/dnsmasq/dnsmasq.initd | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/main/dnsmasq/dnsmasq.initd b/main/dnsmasq/dnsmasq.initd index 0ebcb3cfc6..4e035c2dd9 100644 --- a/main/dnsmasq/dnsmasq.initd +++ b/main/dnsmasq/dnsmasq.initd @@ -1,12 +1,15 @@ #!/sbin/openrc-run -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/net-dns/dnsmasq/files/dnsmasq-init-r1,v 1.2 2011/12/04 10:28:47 swegener Exp $ -description="Lightweight DNS, TFTP, PXE, router advertisement and DHCP server" -description_reload="Clear cache and reload hosts files" +description="A lightweight DNS, DHCP, RA, TFTP and PXE server" extra_started_commands="reload" +description_reload="Clear cache and reload hosts files" + +command="/usr/sbin/dnsmasq" +# Tell dnsmasq to not create pidfile, that's responsibility of init system. +command_args="-k --pid-file= $DNSMASQ_OPTS" +command_background="yes" +pidfile="/run/dnsmasq.pid" depend() { provide dns @@ -15,24 +18,12 @@ depend() { use logger } -start() { - ebegin "Starting ${SVCNAME}" - start-stop-daemon --start --exec /usr/sbin/dnsmasq \ - --pidfile /var/run/dnsmasq.pid \ - -- -x /var/run/dnsmasq.pid ${DNSMASQ_OPTS} - eend $? -} - -stop() { - ebegin "Stopping ${SVCNAME}" - start-stop-daemon --stop --exec /usr/sbin/dnsmasq \ - --pidfile /var/run/dnsmasq.pid - eend $? +start_pre() { + checkpath -m 0644 -o dnsmasq:dnsmasq -f /var/lib/misc/dnsmasq.leases } reload() { - ebegin "Reloading ${SVCNAME}" - start-stop-daemon --stop --oknodo --signal HUP \ - --exec /usr/sbin/dnsmasq --pidfile /var/run/dnsmasq.pid + ebegin "Reloading $SVCNAME" + kill -HUP "$(cat $pidfile)" eend $? } |