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.
 
 
 
 
 
 

67 lines
2.2 KiB

#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
##
## rc.apache2 -- Run-Commands
##
%config
apache2_enable="$openpkg_rc_def"
apache2_log_files="@l_prefix@/var/apache2/log/access.log"
apache2_log_rotsteps="10"
apache2_log_rotminsize="10M"
apache2_log_rotcomplevel="9"
apache2_log_rotprolog="true"
apache2_log_rotepilog="true"
apache2_err_files="@l_prefix@/var/apache2/log/error.log"
apache2_err_rotsteps="10"
apache2_err_rotminsize="1M"
apache2_err_rotcomplevel="9"
apache2_err_rotprolog="true"
apache2_err_rotepilog="true"
%common
apache2_pidfile="@l_prefix@/var/apache2/run/httpd.pid"
apache2_signal () {
[ -f $apache2_pidfile ] && kill -$1 `cat $apache2_pidfile`
}
%status -u @l_susr@ -o
apache2_usable="no"
apache2_active="no"
@l_prefix@/sbin/apachectl configtest 2>/dev/null && apache2_usable="yes"
rcService apache2 enable yes && \
apache2_signal 0 && apache2_active="yes"
echo "apache2_enable=\"$apache2_enable\""
echo "apache2_usable=\"$apache2_usable\""
echo "apache2_active=\"$apache2_active\""
%start -u @l_susr@
rcService apache2 enable yes || exit 0
@l_prefix@/sbin/apachectl start
%stop -u @l_susr@
rcService apache2 enable yes || exit 0
@l_prefix@/sbin/apachectl stop
%restart -u @l_susr@
rcService apache2 enable yes || exit 0
@l_prefix@/sbin/apachectl restart
%daily -u @l_susr@
rcService apache2 enable yes || exit 0
if [ ".$apache2_log_files" != . ]; then
shtool rotate -f \
-n ${apache2_log_rotsteps} -s ${apache2_log_rotminsize} -d \
-z ${apache2_log_rotcomplevel} -o @l_musr@ -g @l_mgrp@ -m 644 \
-P "$apache2_log_rotprolog" \
-E "@l_prefix@/sbin/apachectl restart; $apache2_log_rotepilog" \
$apache2_log_files
fi
if [ ".$apache2_err_files" != . ]; then
shtool rotate -f \
-n ${apache2_err_rotsteps} -s ${apache2_err_rotminsize} -d \
-z ${apache2_err_rotcomplevel} -o @l_musr@ -g @l_mgrp@ -m 644 \
-P "$apache2_err_rotprolog" \
-E "@l_prefix@/sbin/apachectl restart; $apache2_err_rotepilog" \
$apache2_err_files
fi