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.
 
 
 
 
 
 

61 lines
1.5 KiB

#!@l_prefix@/bin/openpkg rc
##
## rc.h2o -- Run-Commands
##
%config
h2o_enable="$openpkg_rc_def"
h2o_flags=""
h2o_log_prolog="true"
h2o_log_epilog="true"
h2o_log_numfiles="10"
h2o_log_minsize="1M"
h2o_log_complevel="9"
%common
h2o_cfgfile="@l_prefix@/etc/h2o/h2o.conf"
h2o_pidfile="@l_prefix@/var/h2o/run/h2o.pid"
h2o_logfile="@l_prefix@/var/h2o/log/h2o.log"
h2o_signal () {
[ -f $h2o_pidfile ] && kill -$1 `cat $h2o_pidfile`
}
%status -u @l_nusr@ -o
h2o_usable="unknown"
h2o_active="no"
rcService h2o enable yes && \
h2o_signal 0 && h2o_active="yes"
echo "h2o_enable=\"$h2o_enable\""
echo "h2o_usable=\"$h2o_usable\""
echo "h2o_active=\"$h2o_active\""
%start -u @l_nusr@
rcService h2o enable yes || exit 0
rcService h2o active yes && exit 0
@l_prefix@/bin/h2o \
-c "$h2o_cfgfile" \
-m daemon \
$h2o_flags \
</dev/null >>$h2o_logfile 2>&1
%stop -u @l_nusr@
rcService h2o enable yes || exit 0
rcService h2o active no && exit 0
h2o_signal TERM
sleep 2
rm -f $h2o_pidfile >/dev/null 2>&1 || true
%restart -u @l_nusr@
rcService h2o enable yes || exit 0
rcService h2o active no && exit 0
rc h2o stop start
%daily -u @l_nusr@
rcService h2o enable yes || exit 0
shtool rotate -f \
-n ${h2o_log_numfiles} -s ${h2o_log_minsize} -d \
-z ${h2o_log_complevel} -m 664 -o @l_nusr@ -g @l_ngrp@ \
-P "${h2o_log_prolog}" \
-E "${h2o_log_epilog}; rc h2o restart" \
$h2o_logfile