nsd.initd 639 Bytes
Newer Older
1
#!/sbin/openrc-run
Matt Smith's avatar
Matt Smith committed
2

3
description="NSD is an authoritative-only, high performance, open source name server"
4 5 6 7 8 9 10
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"
Matt Smith's avatar
Matt Smith committed
11 12

depend() {
13 14
	need net
	use logger
Matt Smith's avatar
Matt Smith committed
15 16
}

17
start_pre() {
18 19 20 21 22 23
	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 $?
Matt Smith's avatar
Matt Smith committed
24
}