| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
- ##
- ## rc.rt -- Run-Commands
- ##
- %config
- rt_enable="$openpkg_rc_def"
- rt_log_files="@l_prefix@/var/rt/log/access.log"
- rt_log_rotsteps="10"
- rt_log_rotminsize="10M"
- rt_log_rotcomplevel="9"
- rt_log_rotprolog="true"
- rt_log_rotepilog="true"
- rt_err_files="@l_prefix@/var/rt/log/error.log"
- rt_err_rotsteps="10"
- rt_err_rotminsize="1M"
- rt_err_rotcomplevel="9"
- rt_err_rotprolog="true"
- rt_err_rotepilog="true"
- rt_apachectl=@l_prefix@/libexec/rt/tools/rtapachectl
- rt_sessiondir=@l_prefix@/var/rt/mason-session
- %start -u @l_rusr@
- rcService rt enable yes || exit 0
- ${rt_apachectl} start
- %stop -u @l_rusr@
- rcService rt enable yes || exit 0
- ${rt_apachectl} stop
- sleep 2
- %restart -u @l_rusr@
- rcService rt enable yes || exit 0
- ${rt_apachectl} stop
- sleep 2
- ${rt_apachectl} start
- %hourly -u @l_rusr@
- rcService rt enable yes || exit 0
- find $rt_sessiondir -type f -amin +600 -exec rm '{}' \;
- %daily -u @l_rusr@
- rcService rt enable yes || exit 0
- if [ ".$rt_log_files" != . ]; then
- shtool rotate -f \
- -n ${rt_log_rotsteps} -s ${rt_log_rotminsize} -d \
- -z ${rt_log_rotcomplevel} -o @l_musr@ -g @l_mgrp@ -m 644 \
- -P "$rt_log_rotprolog" \
- -E "${rt_apachectl} restart; $rt_log_rotepilog" \
- $rt_log_files
- fi
- if [ ".$rt_err_files" != . ]; then
- shtool rotate -f \
- -n ${rt_err_rotsteps} -s ${rt_err_rotminsize} -d \
- -z ${rt_err_rotcomplevel} -o @l_musr@ -g @l_mgrp@ -m 644 \
- -P "$rt_err_rotprolog" \
- -E "${rt_apachectl} restart; $rt_err_rotepilog" \
- $rt_err_files
- fi
|