summaryrefslogtreecommitdiff
path: root/user/dnsmasq/dnsmasq.initd
blob: 559cb1e89d47f3c22880f9d8a19f76a4ec20bbba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later

extra_started_commands="reload rotate"

pidfile="/var/run/dnsmasq.pid"
command="/usr/sbin/dnsmasq"
command_args="-x ${pidfile} ${DNSMASQ_OPTS}"
retry="TERM/3/TERM/5"

depend() {
	provide dns
	need localmount net
	after bootmisc
	use logger
}

reload() {
	ebegin "Reloading ${RC_SVCNAME}"
	start-stop-daemon --signal HUP --pidfile "${pidfile}"
	eend $?
}

rotate() {
	ebegin "Reopening ${RC_SVCNAME} log file"
	start-stop-daemon --signal USR2 --pidfile "${pidfile}"
	eend $?
}