SOURCES: argus.init - pldize

glen glen at pld-linux.org
Tue Feb 27 14:46:22 CET 2007


Author: glen                         Date: Tue Feb 27 13:46:22 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- pldize

---- Files affected:
SOURCES:
   argus.init (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/argus.init
diff -u SOURCES/argus.init:1.1 SOURCES/argus.init:1.2
--- SOURCES/argus.init:1.1	Tue Feb 27 14:28:14 2007
+++ SOURCES/argus.init	Tue Feb 27 14:46:17 2007
@@ -9,58 +9,70 @@
 
 # Get service config
 if [ -f /etc/sysconfig/argus ]; then
-        . /etc/sysconfig/argus
+	. /etc/sysconfig/argus
 else
 	nls "Error: %s not found" /etc/sysconfig/argus
 	nls "argus daemon can't be run."
-        exit 1
+	exit 1
 fi
 
-case "$1" in
-    start)
-	    if [ ! -f /var/lock/subsys/argus ]; then
-		msg_starting "argus"
+start() {
+	if [ ! -f /var/lock/subsys/argus ]; then
+		msg_starting argus
 		daemon --user argus argus -d -w /var/log/argus/argus.log
 		RETVAL=$?
 		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/argus
-	    else
-		msg_already_running "argus"
-	    fi
-	    ;;
-
-    stop)
-	    if [ -f /var/lock/subsys/argus ]; then
-		msg_stopping "argus"
+	else
+		msg_already_running argus
+	fi
+}
+
+stop() {
+	if [ -f /var/lock/subsys/argus ]; then
+		msg_stopping argus
 		killproc argus
 		rm -f /var/lock/subsys/argus
-	    fi
-	    ;;
+	else
+		msg_not_running argus
+		RETVAL=7
+	fi
+}
 
-    restart)
-	    $0 stop
-	    $0 start
-	    exit $?
-	    ;;
-
-    reload|force-reload)
-	    if [ -f /var/lock/subsys/argus ]; then
-		msg_reloading "argus"
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+
+  stop)
+  	stop
+	;;
+
+  restart)
+	stop
+	start
+	;;
+
+  reload|force-reload)
+	if [ -f /var/lock/subsys/argus ]; then
+		msg_reloading argus
 		killproc argus -HUP
 		RETVAL=$?
-	    else
-		msg_not_running argus >&2
+	else
+		msg_not_running argus
 		exit 7
-	    fi
-	    ;;
-
-    status)
-	    status argus
-    ;;
-
-    *)
-    echo $"Usage: $0 {start|stop|reload|force-reload|status}"
-    exit 1
+	fi
+	;;
 
+  status)
+	status argus
+	RETVAL=$?
+	;;
+
+  *)
+	msg_usage "$0 {start|stop|reload|force-reload|status}"
+	exit 3
 esac
 
-exit 0
+exit $RETVAL
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/argus.init?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list