mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-11-02 17:31:32 +01:00
30 lines
816 B
Bash
30 lines
816 B
Bash
#!/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 >/dev/null 2>&1"}
|
|
: ${wait:=50} # milliseconds
|
|
|
|
command="/usr/sbin/kres-cache-gc"
|
|
command_background="yes"
|
|
pidfile="/run/$RC_SVCNAME.pid"
|
|
start_stop_daemon_args="--wait $wait"
|
|
# The leading space is to avoid fallback to $start_stop_daemon_args when this
|
|
# is empty (supervise-daemon doesn't support --wait).
|
|
supervise_daemon_args=" $supervise_daemon_args"
|
|
|
|
depend() {
|
|
need localmount
|
|
}
|
|
|
|
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:-}"
|
|
}
|