aboutsummaryrefslogtreecommitdiffstats
path: root/community/knot-resolver/kresd.initd
blob: 1ef4b19560f70768ffbae5c922acb88da18b39f6 (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

: ${command_user:="kresd:kresd"}
: ${cfgfile:=${config:-"/etc/knot-resolver/kresd.conf"}}
: ${cachedir:="/var/cache/knot-resolver"}
: ${output_logger="logger -t kresd -p daemon.info"}
: ${wait:=100}

command="/usr/sbin/kresd"
command_args="--noninteractive --config=$cfgfile $cachedir"
command_background="yes"
pidfile="/run/$RC_SVCNAME.pid"
start_stop_daemon_args="--chdir=$cachedir --wait $wait"
required_files="$cfgfile"

depend() {
	need net
	before kres-cache-gc
}

start_pre() {
	[ "$output_log" ] && checkpath -f -m 640 -o "$command_user" "$output_log"
	checkpath -d -m 750 -o "$command_user" "$cachedir"
}