aboutsummaryrefslogtreecommitdiffstats
path: root/community/knot-resolver/kres-cache-gc.initd
blob: faa64426dabfbe152f141183356af408d9470f75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/sbin/openrc-run

description="Knot Resolver Cache Garbage Collector"

: ${command_user:="kresd"}
: ${garbage_interval:=1000}
: ${output_logger="logger -t kres-cache-gc -p daemon.info"}
: ${wait:=50}  # milliseconds

command="/usr/sbin/kres-cache-gc"
command_background="yes"
pidfile="/run/$RC_SVCNAME.pid"
start_stop_daemon_args="--wait $wait"

start_pre() {
	if [ -z "$cachedir" ] && [ -e /etc/conf.d/kresd ]; then
		cachedir=$(. /etc/conf.d/kresd; echo "$cachedir")
	fi
	: ${cachedir:="/var/cache/knot-resolver"}

	command_args="-c $cachedir -d $garbage_interval ${command_args:-}"
}