|
|
@@ -19,15 +19,17 @@
|
|
|
apache_err_complevel="9"
|
|
|
|
|
|
%common
|
|
|
- . @l_prefix@/etc/apache/apache.sh
|
|
|
+ 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/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"
|
|
|
+ @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\""
|
|
|
@@ -35,18 +37,27 @@
|
|
|
%start -u @l_susr@
|
|
|
rcService apache enable yes || exit 0
|
|
|
rcService apache active yes && exit 0
|
|
|
- @l_prefix@/sbin/apachectl start
|
|
|
+ ( [ -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
|
|
|
- @l_prefix@/sbin/apachectl stop
|
|
|
+ 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/apachectl restart
|
|
|
+ rc apache stop start
|
|
|
+
|
|
|
+%reload -u @l_susr@
|
|
|
+ rcService apache enable yes || exit 0
|
|
|
+ rcService apache active no && exit 0
|
|
|
+ apache_signal HUP
|
|
|
|
|
|
%daily -u @l_susr@
|
|
|
rcService apache enable yes || exit 0
|
|
|
@@ -57,7 +68,7 @@
|
|
|
-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 restart" \
|
|
|
+ -E "${apache_log_epilog} && rc apache reload" \
|
|
|
$apache_log_files
|
|
|
fi
|
|
|
|
|
|
@@ -67,7 +78,7 @@
|
|
|
-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 restart" \
|
|
|
+ -E "${apache_err_epilog} && rc apache reload" \
|
|
|
$apache_err_files
|
|
|
fi
|
|
|
|