]> git.pld-linux.org Git - packages/apache.git/commitdiff
- added try-restart action (LSB 3.1)
authorJakub Bogusz <qboosh@pld-linux.org>
Sat, 26 Jan 2008 12:42:55 +0000 (12:42 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- removed duplicate force-reload code

Changed files:
    apache.init -> 1.57

apache.init

index d93573a904ddfdb76ce46b5fdcd3e6e57a8ba874..763a0320714287720f9910a940732938a8b334b3 100644 (file)
@@ -62,6 +62,16 @@ stop() {
        fi
 }
 
+condrestart() {
+       if [ -f /var/lock/subsys/httpd ]; then
+               stop
+               start
+       else
+               msg_not_running httpd.${HTTPD_MPM}
+               RETVAL=$1
+       fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -80,6 +90,9 @@ case "$1" in
        stop
        start
        ;;
+  try-restart)
+       condrestart 0
+       ;;
   reload|force-reload|graceful)
        if [ -f /var/lock/subsys/httpd ]; then
                run_cmd "Checking httpd.${HTTPD_MPM} configuration" httpd.${HTTPD_MPM} $CFG -t
@@ -109,24 +122,8 @@ case "$1" in
                fi
        fi
        ;;
-  force-reload)
-       if [ -f /var/lock/subsys/httpd ]; then
-               run_cmd "Checking httpd.${HTTPD_MPM} configuration" httpd.${HTTPD_MPM} $CFG -t
-               RETVAL=$?
-               if [ $RETVAL -eq 0 ]; then
-                       msg_reloading httpd.${HTTPD_MPM}
-                       # forced reload
-                       daemon httpd.${HTTPD_MPM} $CFG -k restart
-                       RETVAL=$?
-               fi
-       else
-               msg_not_running httpd.${HTTPD_MPM}
-               RETVAL=7
-       fi
-       ;;
-
   *)
-       msg_usage "$0 {start|stop|restart|reload|force-reload|graceful|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|graceful|status}"
        exit 3
        ;;
 esac
This page took 0.040051 seconds and 4 git commands to generate.