]> git.pld-linux.org Git - packages/apache.git/blobdiff - apache.init
- C: logrotate < 3.7.4 due to archiv -> archive transition
[packages/apache.git] / apache.init
index e067c46e34cb07d8bbadb17e308f2cd38b9dd56b..d93573a904ddfdb76ce46b5fdcd3e6e57a8ba874 100644 (file)
@@ -39,10 +39,7 @@ if [ -n "${HTTPD_CONF}" ]; then
        fi
 fi
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/httpd ]; then
                msg_starting httpd.${HTTPD_MPM}
@@ -52,8 +49,9 @@ case "$1" in
        else
                msg_already_running httpd.${HTTPD_MPM}
        fi
-       ;;
-  stop)
+}
+
+stop() {
        # Stop daemons.
        if [ -f /var/lock/subsys/httpd ]; then
                msg_stopping httpd.${HTTPD_MPM}
@@ -62,6 +60,16 @@ case "$1" in
        else
                msg_not_running httpd.${HTTPD_MPM}
        fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   status)
        status httpd.${HTTPD_MPM}
@@ -69,8 +77,8 @@ case "$1" in
        /usr/sbin/httpd.${HTTPD_MPM} $CFG -S
        ;;
   restart)
-       $0 stop
-       $0 start
+       stop
+       start
        ;;
   reload|force-reload|graceful)
        if [ -f /var/lock/subsys/httpd ]; then
@@ -82,10 +90,25 @@ case "$1" in
                        RETVAL=$?
                fi
        else
-               msg_not_running httpd.${HTTPD_MPM} >&2
+               msg_not_running httpd.${HTTPD_MPM}
                RETVAL=7
        fi
        ;;
+  flush-logs)
+       if [ -f /var/lock/subsys/httpd ]; then
+               msg_reloading httpd.${HTTPD_MPM}
+
+               httpd.${HTTPD_MPM} -t >/dev/null 2>&1
+               RETVAL=$?
+               if [ $RETVAL -eq 0 ]; then
+                       daemon httpd.${HTTPD_MPM} $CFG -k graceful
+                       RETVAL=$?
+               else
+                       fail
+                       echo >&2 "Configuration file syntax test failed."
+               fi
+       fi
+       ;;
   force-reload)
        if [ -f /var/lock/subsys/httpd ]; then
                run_cmd "Checking httpd.${HTTPD_MPM} configuration" httpd.${HTTPD_MPM} $CFG -t
@@ -97,7 +120,7 @@ case "$1" in
                        RETVAL=$?
                fi
        else
-               msg_not_running httpd.${HTTPD_MPM} >&2
+               msg_not_running httpd.${HTTPD_MPM}
                RETVAL=7
        fi
        ;;
This page took 0.032822 seconds and 4 git commands to generate.