Author: qboosh                       Date: Sun Nov 25 11:43:00 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- force-reload means reload if reload is supported
- introduced try-restart (as specified by LSB 3.1)

---- Files affected:
SOURCES:
   squid.init (1.49 -> 1.50) 

---- Diffs:

================================================================
Index: SOURCES/squid.init
diff -u SOURCES/squid.init:1.49 SOURCES/squid.init:1.50
--- SOURCES/squid.init:1.49     Fri Nov 23 13:57:51 2007
+++ SOURCES/squid.init  Sun Nov 25 12:42:55 2007
@@ -148,6 +148,20 @@
        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 @@
   stop)
        stop
        ;;
-  restart|force-reload)
+  restart)
        restart
        ;;
-  reload)
+  try-restart)
+       condrestart
+       ;;
+  reload|force-reload)
        reload
        ;;
   status)
@@ -172,7 +189,7 @@
        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
 
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/squid.init?r1=1.49&r2=1.50&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to