forked from Lainports/freebsd-ports
32 lines
772 B
Bash
32 lines
772 B
Bash
#!/bin/sh
|
|
|
|
# PROVIDE: krescachegc
|
|
# REQUIRE: SERVERS cleanvar
|
|
# KEYWORD: shutdown
|
|
#
|
|
# Add the following lines to /etc/rc.conf to enable knot-resolver:
|
|
#
|
|
# krescachegc_enable="YES": Set to YES to enable krescachegc.
|
|
# Set to NO by default.
|
|
# krescachegc_millis="1000": Set to garbage collect interval in milliseconds
|
|
# Set to 1000 by default.
|
|
#
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=krescachegc
|
|
rcvar=krescachegc_enable
|
|
|
|
load_rc_config ${name}
|
|
|
|
# set defaults
|
|
krescachegc_enable=${krescachegc_enable:-"NO"}
|
|
krescachegc_millis=${krescachegc_millis:-"1000"}
|
|
|
|
pidfile="%%RUNDIR%%/${name}.pid"
|
|
procname="%%PREFIX%%/sbin/kres-cache-gc"
|
|
|
|
command=/usr/sbin/daemon
|
|
command_args="-c -f -S -r -P ${pidfile} -T ${name} -u %%USERS%% -- ${procname} -d ${krescachegc_millis}"
|
|
|
|
run_rc_command "$1"
|