Bläddra i källkod

fixed rc script

Christoph Schug 22 år sedan
förälder
incheckning
34624db07e
2 ändrade filer med 22 tillägg och 11 borttagningar
  1. 1 1
      apache/apache.spec
  2. 21 10
      apache/rc.apache

+ 1 - 1
apache/apache.spec

@@ -62,7 +62,7 @@ Distribution: OpenPKG [BASE]
 Group:        Web
 License:      ASF
 Version:      %{V_apache}
-Release:      20040110
+Release:      20040112
 
 #   package options (suexec related)
 %option       with_suexec               yes

+ 21 - 10
apache/rc.apache

@@ -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