diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2020-02-23 10:49:30 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2020-02-23 14:08:49 +0100 |
commit | 1f144a1e6cdcf1fb9eb81f3249fd4f575f31d043 (patch) | |
tree | 98d71eefa08ac052606b5baa554a976b0efa5433 /community/knot-resolver/kres-cache-gc.initd | |
parent | 58d3aa5473a10c8d175b4b7f24d7f63b3b26a7b0 (diff) | |
download | aports-1f144a1e6cdcf1fb9eb81f3249fd4f575f31d043.tar.bz2 aports-1f144a1e6cdcf1fb9eb81f3249fd4f575f31d043.tar.xz |
community/knot-resolver: add init script for kres-cache-gc
Diffstat (limited to 'community/knot-resolver/kres-cache-gc.initd')
-rw-r--r-- | community/knot-resolver/kres-cache-gc.initd | 22 |
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:-}" +} |