aboutsummaryrefslogtreecommitdiffstats
path: root/community/knot-resolver/kres-cache-gc.initd
diff options
context:
space:
mode:
Diffstat (limited to 'community/knot-resolver/kres-cache-gc.initd')
-rw-r--r--community/knot-resolver/kres-cache-gc.initd22
1 files changed, 22 insertions, 0 deletions
diff --git a/community/knot-resolver/kres-cache-gc.initd b/community/knot-resolver/kres-cache-gc.initd
new file mode 100644
index 0000000000..643186b649
--- /dev/null
+++ b/community/knot-resolver/kres-cache-gc.initd
@@ -0,0 +1,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/knot-resolver ]; then
+ cachedir=$(. /etc/conf.d/knot-resolver; echo "$cachedir")
+ fi
+ : ${cachedir:="/var/cache/knot-resolver"}
+
+ command_args="-c $cachedir -d $garbage_interval ${command_args:-}"
+}