|
|
|
|
#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
|
|
|
|
|
##
|
|
|
|
|
## rc.apache -- Run-Commands
|
|
|
|
|
##
|
|
|
|
|
|
|
|
|
|
%config
|
|
|
|
|
apache_enable="$openpkg_rc_def"
|
|
|
|
|
apache_log_files="@l_prefix@/var/apache/log/access.log"
|
|
|
|
|
apache_log_prolog="true"
|
|
|
|
|
apache_log_epilog="true"
|
|
|
|
|
apache_log_numfiles="10"
|
|
|
|
|
apache_log_minsize="1M"
|
|
|
|
|
apache_log_complevel="9"
|
|
|
|
|
apache_err_files="@l_prefix@/var/apache/log/error.log"
|
|
|
|
|
apache_err_prolog="true"
|
|
|
|
|
apache_err_epilog="true"
|
|
|
|
|
apache_err_numfiles="10"
|
|
|
|
|
apache_err_minsize="1M"
|
|
|
|
|
apache_err_complevel="9"
|
|
|
|
|
|
|
|
|
|
%common
|
|
|
|
|
apache_pidfile="@l_prefix@/var/apache/run/apache.pid"
|
|
|
|
|
apache_signal () {
|
|
|
|
|
[ -f $apache_pidfile ] && kill -$1 `cat $apache_pidfile`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
%status -u @l_susr@ -o
|
|
|
|
|
apache_usable="no"
|
|
|
|
|
apache_active="no"
|
|
|
|
|
@l_prefix@/sbin/apache -t 2>/dev/null && apache_usable="yes"
|
|
|
|
|
rcService apache enable yes && \
|
|
|
|
|
apache_signal 0 && apache_active="yes"
|
|
|
|
|
echo "apache_enable=\"$apache_enable\""
|
|
|
|
|
echo "apache_usable=\"$apache_usable\""
|
|
|
|
|
echo "apache_active=\"$apache_active\""
|
|
|
|
|
|
|
|
|
|
%start -u @l_susr@
|
|
|
|
|
rcService apache enable yes || exit 0
|
|
|
|
|
rcService apache active yes && exit 0
|
|
|
|
|
( [ -e @l_prefix@/etc/apache/apache.sh ] && \
|
|
|
|
|
. @l_prefix@/etc/apache/apache.sh
|
|
|
|
|
@l_prefix@/sbin/apache
|
|
|
|
|
) || return $?
|
|
|
|
|
|
|
|
|
|
%stop -u @l_susr@
|
|
|
|
|
rcService apache enable yes || exit 0
|
|
|
|
|
rcService apache active no && exit 0
|
|
|
|
|
apache_signal TERM
|
|
|
|
|
sleep 2
|
|
|
|
|
rm -f $apache_pidfile >/dev/null 2>&1 || true
|
|
|
|
|
|
|
|
|
|
%restart -u @l_susr@
|
|
|
|
|
rcService apache enable yes || exit 0
|
|
|
|
|
rcService apache active no && exit 0
|
|
|
|
|
@l_prefix@/sbin/apache -t || exit $?
|
|
|
|
|
rc apache stop start
|
|
|
|
|
|
|
|
|
|
%reload -u @l_susr@
|
|
|
|
|
rcService apache enable yes || exit 0
|
|
|
|
|
rcService apache active no && exit 0
|
|
|
|
|
@l_prefix@/sbin/apache -t || exit $?
|
|
|
|
|
apache_signal USR1
|
|
|
|
|
|
|
|
|
|
%daily -u @l_susr@
|
|
|
|
|
rcService apache enable yes || exit 0
|
|
|
|
|
if [ ".$apache_log_files" != . ]; then
|
|
|
|
|
shtool rotate -f \
|
|
|
|
|
-n ${apache_log_numfiles} -s ${apache_log_minsize} -d \
|
|
|
|
|
-z ${apache_log_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \
|
|
|
|
|
-P "${apache_log_prolog}" \
|
|
|
|
|
-E "${apache_log_epilog} && rc apache reload" \
|
|
|
|
|
$apache_log_files
|
|
|
|
|
fi
|
|
|
|
|
if [ ".$apache_err_files" != . ]; then
|
|
|
|
|
shtool rotate -f \
|
|
|
|
|
-n ${apache_err_numfiles} -s ${apache_err_minsize} -d \
|
|
|
|
|
-z ${apache_err_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \
|
|
|
|
|
-P "${apache_err_prolog}" \
|
|
|
|
|
-E "${apache_err_epilog} && rc apache reload" \
|
|
|
|
|
$apache_err_files
|
|
|
|
|
fi
|
|
|
|
|
|