]> git.pld-linux.org Git - packages/apache.git/commitdiff
- apache config syntax check before restarting
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 18 May 2005 14:20:26 +0000 (14:20 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    apache1.init -> 1.13

apache1.init

index db9b8e9d8d67bb4410d1dec939a77cb0be2889c1..d677835df0c8a6c8eb0779646df2cd5cc1b3eed9 100644 (file)
@@ -71,8 +71,15 @@ case "$1" in
   reload|force-reload)
        if [ -f /var/lock/subsys/apache ]; then
                msg_reloading apache
-               killproc apache -HUP
+
+               apache -t > /dev/null 2>&1
                RETVAL=$?
+               if [ $RETVAL -eq 0 ]; then
+                       killproc apache -HUP
+               else
+                   fail
+                   echo "Configuration file syntax test failed."
+               fi
        else
                msg_not_running apache >&2
                RETVAL=7
@@ -81,9 +88,16 @@ case "$1" in
   graceful)
        if [ -f /var/lock/subsys/apache ]; then
                msg_reloading apache
-               killproc apache -USR1
+
+               apache -t > /dev/null 2>&1
                RETVAL=$?
-        else
+               if [ $RETVAL -eq 0 ]; then
+                       killproc apache -USR1
+               else
+                   fail
+                   echo "Configuration file syntax test failed."
+               fi
+       else
                msg_not_running apache >&2
                RETVAL=7
        fi
This page took 0.039388 seconds and 4 git commands to generate.