]> git.pld-linux.org Git - packages/squid.git/commitdiff
- force-reload means reload if reload is supported
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 25 Nov 2007 11:42:55 +0000 (11:42 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- introduced try-restart (as specified by LSB 3.1)

Changed files:
    squid.init -> 1.50

squid.init

index 03c8a6a49c9ecc2ba38ad5bfd8a2cd0fb7dde350..4d0b9f7e86077fdbcf516406f673d2a166222aa7 100644 (file)
@@ -148,6 +148,20 @@ restart() {
        start
 }
 
+condrestart() {
+       # if service is up, do configtest
+       if [ -f /var/lock/subsys/squid ]; then
+               configtest
+               if [ $RETVAL != 0 ]; then
+                       exit 1
+               fi
+               stop
+               start
+       else
+               RETVAL=0
+       fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -157,10 +171,13 @@ case "$1" in
   stop)
        stop
        ;;
-  restart|force-reload)
+  restart)
        restart
        ;;
-  reload)
+  try-restart)
+       condrestart
+       ;;
+  reload|force-reload)
        reload
        ;;
   status)
@@ -172,7 +189,7 @@ case "$1" in
        check_cache_dirs
        ;;
   *)
-       msg_usage "$0 {start|stop|init|restart|reload|force-reload|status}"
+       msg_usage "$0 {start|stop|init|restart|try-restart|reload|force-reload|status}"
        exit 3
 esac
 
This page took 0.311045 seconds and 4 git commands to generate.