aboutsummaryrefslogtreecommitdiffstats
path: root/main/nsd/nsd.initd
blob: 9eab28523882b731eb0a4f30ebc4a989ea8d47ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/sbin/openrc-run

description="NSD is an authoritative-only, high performance, open source name server"
checkconf=/usr/sbin/nsd-checkconf
cfgfile=${NSD_CONFIG:-/etc/nsd/nsd.conf}
pidfile=$($checkconf -o pidfile $cfgfile)
pidfile=${pidfile:-/var/run/nsd/nsd.pid}
command=/usr/sbin/nsd
command_args=""
required_files="$cfgfile"

depend() {
	need net
	use logger
}

start_pre() {
	ebegin
	checkpath --directory --owner nsd:nsd ${pidfile%/*}
	$checkconf $cfgfile
	[ "$cfgfile" = "/etc/nsd/nsd.conf" ] || command_args="$command_args -c $cfgfile"
	[ "$pidfile" = "/var/run/nsd/nsd.pid" ] || command_args="$command_args -P $pidfile"
	eend $?
}