SOURCES: apache-tomcat.init - add try-restart

glen glen at pld-linux.org
Fri Oct 3 20:55:12 CEST 2008


Author: glen                         Date: Fri Oct  3 18:55:12 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- add try-restart

---- Files affected:
SOURCES:
   apache-tomcat.init (1.9 -> 1.10) 

---- Diffs:

================================================================
Index: SOURCES/apache-tomcat.init
diff -u SOURCES/apache-tomcat.init:1.9 SOURCES/apache-tomcat.init:1.10
--- SOURCES/apache-tomcat.init:1.9	Fri Oct  3 20:54:08 2008
+++ SOURCES/apache-tomcat.init	Fri Oct  3 20:55:06 2008
@@ -59,6 +59,16 @@
 	fi
 }
 
+condrestart() {
+	if [ -f /var/lock/subsys/tomcat ]; then
+		stop
+		start
+	else
+		msg_not_running tomcat
+		RETVAL=$1
+	fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -68,16 +78,22 @@
   stop)
   	stop
 	;;
-  restart|force-reload)
+  restart)
 	stop
 	start
 	;;
+  try-restart)
+	condrestart 0
+	;;
+  force-reload)
+	condrestart 7
+	;;
   status)
 	echo "Not supported (yet?)"
 	RETVAL=0
 	;;
   *)
-	msg_usage "$0 {start|stop|restart|force-reload|status}"
+	msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
 	exit 3
 esac
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/apache-tomcat.init?r1=1.9&r2=1.10&f=u



More information about the pld-cvs-commit mailing list