SOURCES: firebird.init - force-reload is not supposed to start ser...

qboosh qboosh at pld-linux.org
Fri Jan 4 12:36:18 CET 2008


Author: qboosh                       Date: Fri Jan  4 11:36:18 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- force-reload is not supposed to start service if not running
- added try-restart action (LSB 3.1)

---- Files affected:
SOURCES:
   firebird.init (1.3 -> 1.4) 

---- Diffs:

================================================================
Index: SOURCES/firebird.init
diff -u SOURCES/firebird.init:1.3 SOURCES/firebird.init:1.4
--- SOURCES/firebird.init:1.3	Sun Apr 30 20:53:29 2006
+++ SOURCES/firebird.init	Fri Jan  4 12:36:12 2008
@@ -29,11 +29,7 @@
 	exit 0
 fi
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
-	# Start daemons.
+start() {
 	if [ ! -f /var/lock/subsys/firebird ]; then
 		msg_starting firebird
 		daemon --user firebird $DAEMON -start -forever
@@ -42,9 +38,9 @@
 	else
 		msg_already_running firebird
 	fi
-	;;
-  stop)
-	# Stop daemons.
+}
+
+stop() {
 	if [ -f /var/lock/subsys/firebird ]; then
 		msg_stopping firebird
 		daemon --user firebird $DAEMON -shut
@@ -52,18 +48,43 @@
 	else
 		msg_not_running firebird
 	fi
+}
+
+condrestart() {
+	if [ -f /var/lock/subsys/firebird ]; then
+		stop
+		start
+	else
+		msg_not_running firebird
+		RETVAL=$1
+	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+	start
 	;;
-  restart|force-reload)
-	$0 stop
-	$0 start
-	exit $?
+  stop)
+	stop
+	;;
+  restart)
+	stop
+	start
+	;;
+  try-restart)
+	condrestart 0
+	;;
+  force-reload)
+	condrestart 7
 	;;
   status)
 	status fb_inet_server
 	exit $?
 	;;
   *)
-	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/firebird.init?r1=1.3&r2=1.4&f=u



More information about the pld-cvs-commit mailing list