SOURCES: 3dm2-7000.init (NEW) - initrial release

pascalek pascalek at pld-linux.org
Thu Dec 14 13:40:44 CET 2006


Author: pascalek                     Date: Thu Dec 14 12:40:44 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- initrial release

---- Files affected:
SOURCES:
   3dm2-7000.init (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/3dm2-7000.init
diff -u /dev/null SOURCES/3dm2-7000.init:1.1
--- /dev/null	Thu Dec 14 13:40:44 2006
+++ SOURCES/3dm2-7000.init	Thu Dec 14 13:40:39 2006
@@ -0,0 +1,69 @@
+#!/bin/sh
+#
+# 3dm2:     	Starts the 3ware daemon
+#
+# Author:       Rafal Cygnarowski <pascalek at pld-linux.org>
+#
+# chkconfig:	345 40 60
+# description:	Start the 3dm2 application which logs the current state
+#             	of the 3ware DiskSwitch controller card, and then polls
+#		for state changes.
+#
+# processname:	3dm2
+# config:	/etc/3dm2/3dm2.conf
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+RETVAL=0
+
+# See how we were called.
+case "$1" in
+  start)
+  	if [ ! -f /var/lock/subsys/3dm2 ]; then
+	    msg_starting "3DM2 Utility"
+	    start-stop-daemon --start --quiet --exec /usr/sbin/3dm2
+	    RETVAL=$?
+	    if [ $RETVAL -eq 0 ]; then 
+		ok 
+		touch /var/lock/subsys/3dm2
+	    else
+		fail
+		RETVAL=1
+	    fi
+	else
+	    msg_already_running "3DM2 Utility"
+	fi
+	;;
+  stop)
+	if [ -f /var/lock/subsys/3dm2 ]; then
+	    msg_stopping "3DM2 Utility"
+	    start-stop-daemon --stop --quiet --exec /usr/sbin/3dm2 1> /dev/null
+	    RETVAL=$?
+	    if [ $RETVAL -eq 0 ]; then 
+		ok 
+		rm -f /var/lock/subsys/3dm2
+	    else
+		fail
+		RETVAL=1
+	    fi
+	else
+	    msg_not_running "3DM2 Utility"
+	fi
+	;;
+  status)
+	status 3dm2
+	RETVAL=$?
+	;;
+  restart)
+	$0 stop
+	sleep 2
+	$0 start
+	RETVAL=$?
+	;;
+  *)
+	echo "Usage: $0 {start|stop|status|restart}"
+	exit 1
+esac
+
+exit $RETVAL
================================================================


More information about the pld-cvs-commit mailing list