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.

64 lines
2.1 KiB

#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
25 years ago
##
## rc.apache -- Run-Commands
25 years ago
##
%config
apache_enable="$openpkg_rc_def"
25 years ago
apache_log_files="@l_prefix@/var/apache/log/access.log"
apache_log_rotsteps="10"
apache_log_rotminsize="10M"
apache_log_rotcomplevel="9"
apache_log_rotprolog="true"
apache_log_rotepilog="true"
apache_err_files="@l_prefix@/var/apache/log/error.log"
apache_err_rotsteps="10"
apache_err_rotminsize="1M"
apache_err_rotcomplevel="9"
apache_err_rotprolog="true"
apache_err_rotepilog="true"
23 years ago
%status -p 200 -u @l_susr@ -o
apache_usable="no"
apache_active="no"
@l_prefix@/sbin/apachectl configtest 2>/dev/null && apache_usable="yes"
( eval `grep "^PIDFILE=" @l_prefix@/sbin/apachectl`
[ ".$PIDFILE" != . -a -f "$PIDFILE" ] && kill -0 `cat $PIDFILE`
) && apache_active="yes"
echo "apache_enable=\"$apache_enable\""
echo "apache_usable=\"$apache_usable\""
echo "apache_active=\"$apache_active\""
%start -p 200 -u @l_susr@
rcService apache enable yes || exit 0
25 years ago
@l_prefix@/sbin/apachectl start
%stop -p 200 -u @l_susr@
rcService apache enable yes || exit 0
25 years ago
@l_prefix@/sbin/apachectl stop
sleep 2
%restart -u @l_susr@
rcService apache enable yes || exit 0
25 years ago
@l_prefix@/sbin/apachectl restart
%daily -u @l_susr@
rcService apache enable yes || exit 0
25 years ago
if [ ".$apache_log_files" != . ]; then
shtool rotate -f \
-n ${apache_log_rotsteps} -s ${apache_log_rotminsize} -d \
-z ${apache_log_rotcomplevel} -o @l_musr@ -g @l_mgrp@ -m 644 \
25 years ago
-P "$apache_log_rotprolog" \
-E "@l_prefix@/sbin/apachectl restart; $apache_log_rotepilog" \
$apache_log_files
fi
if [ ".$apache_err_files" != . ]; then
shtool rotate -f \
-n ${apache_err_rotsteps} -s ${apache_err_rotminsize} -d \
-z ${apache_err_rotcomplevel} -o @l_musr@ -g @l_mgrp@ -m 644 \
25 years ago
-P "$apache_err_rotprolog" \
-E "@l_prefix@/sbin/apachectl restart; $apache_err_rotepilog" \
$apache_err_files
fi