aboutsummaryrefslogtreecommitdiffstats
path: root/testing/knot-resolver/knot-resolver.initd
blob: 7a4ef61eaf5ab63de5ff4f6d4fdfc07c9557a09b (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
#!/sbin/openrc-run

: ${config:="/etc/knot-resolver/config"}
: ${cachedir:="/var/cache/knot-resolver"}
: ${keyfile:="/var/lib/knot-resolver/root.keys"}
: ${logfile:="/var/log/knot-resolver.log"}

command="/usr/sbin/kresd"
# Note: Do not change forks=1, it's buggy.
command_args="--config=$config --keyfile=$keyfile --forks=1 $cachedir"
command_background="yes"
pidfile="/run/$RC_SVCNAME.pid"
start_stop_daemon_args="
	--chdir=$cachedir
	--stdout=$logfile
	--stderr=$logfile"
required_files="$config"

depend() {
	need net
}

start_pre() {
	checkpath -d -m 750 -o kresd:kresd "$cachedir"
}