SOURCES: mysql-proxy.init - add try-restart - start+stop=100 formula

glen glen at pld-linux.org
Wed Oct 29 23:27:41 CET 2008


Author: glen                         Date: Wed Oct 29 22:27:41 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- add try-restart
- start+stop=100 formula

---- Files affected:
SOURCES:
   mysql-proxy.init (1.6 -> 1.7) 

---- Diffs:

================================================================
Index: SOURCES/mysql-proxy.init
diff -u SOURCES/mysql-proxy.init:1.6 SOURCES/mysql-proxy.init:1.7
--- SOURCES/mysql-proxy.init:1.6	Mon Dec 10 15:08:40 2007
+++ SOURCES/mysql-proxy.init	Wed Oct 29 23:27:35 2008
@@ -2,7 +2,7 @@
 #
 # mysql-proxy	MySQL Proxy
 #
-# chkconfig:	2345 85 24
+# chkconfig:	2345 85 15
 #
 # description:	MySQL Proxy
 #
@@ -65,6 +65,16 @@
 	fi
 }
 
+condrestart() {
+	if [ -f /var/lock/subsys/mysql-proxy ]; then
+		stop
+		start
+	else
+		msg_not_running "MySQL Proxy"
+		RETVAL=$1
+	fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -74,11 +84,14 @@
   stop)
   	stop
 	;;
-  restart|force-reload)
+  restart)
 	stop
 	start
 	;;
-  reload)
+  try-restart)
+	condrestart 0
+	;;
+  reload|force-reload)
   	reload
 	;;
   status)
@@ -86,7 +99,7 @@
 	RETVAL=$?
 	;;
   *)
-	msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+	msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
 	exit 3
 esac
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/mysql-proxy.init?r1=1.6&r2=1.7&f=u



More information about the pld-cvs-commit mailing list