You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

62 lines
1.8 KiB

#!@l_prefix@/bin/openpkg rc
##
## rc.nntpcache -- Run-Commands
##
%config
nntpcache_enable="$openpkg_rc_def"
nntpcache_bind="127.0.0.1"
nntpcache_port="119"
nntpcache_log_prolog="true"
nntpcache_log_epilog="true"
nntpcache_log_numfiles="10"
nntpcache_log_minsize="1M"
nntpcache_log_complevel="9"
%common
nntpcache_pidfile="@l_prefix@/var/nntpcache/nntpcache.pid"
nntpcache_signal () {
[ -f $nntpcache_pidfile ] && kill -$1 `cat $nntpcache_pidfile`
}
nntpcache_start () {
@l_prefix@/sbin/nntpcached \
-b ${nntpcache_bind:-DEFAULT}:${nntpcache_port:-nntp} \
-p $nntpcache_pidfile
}
nntpcache_stop () {
nntpcache_signal TERM
}
%status -u @l_susr@ -o
nntpcache_usable="unknown"
nntpcache_active="no"
rcService nntpcache enable yes && \
nntpcache_signal 0 && nntpcache_active="yes"
echo "nntpcache_enable=\"$nntpcache_enable\""
echo "nntpcache_usable=\"$nntpcache_usable\""
echo "nntpcache_active=\"$nntpcache_active\""
%start -u @l_susr@
rcService nntpcache enable yes || exit 0
rcService nntpcache active yes && exit 0
nntpcache_start
%stop -u @l_susr@
rcService nntpcache enable yes || exit 0
rcService nntpcache active no && exit 0
nntpcache_stop
%restart -u @l_susr@
rcService nntpcache enable yes || exit 0
rcService nntpcache active no && exit 0
rc nntpcache stop start
%daily -u @l_susr@
rcService nntpcache enable yes || exit 0
shtool rotate -f \
-n ${nntpcache_log_numfiles} -s ${nntpcache_log_minsize} -d \
-z ${nntpcache_log_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \
-P "${nntpcache_log_prolog}" \
-E "${nntpcache_log_epilog}; rc nntpcache restart" \
@l_prefix@/var/nntpcache/nntpcache.log