SOURCES: ConfRoom.init (NEW) - initscript for conference room

glen glen at pld-linux.org
Wed Feb 28 20:24:03 CET 2007


Author: glen                         Date: Wed Feb 28 19:24:03 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- initscript for conference room

---- Files affected:
SOURCES:
   ConfRoom.init (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/ConfRoom.init
diff -u /dev/null SOURCES/ConfRoom.init:1.1
--- /dev/null	Wed Feb 28 20:24:03 2007
+++ SOURCES/ConfRoom.init	Wed Feb 28 20:23:58 2007
@@ -0,0 +1,83 @@
+#!/bin/sh
+#
+# cr	conferenceroom ircd service
+#
+# chkconfig:	345 11 89
+#
+# description:	conferenceroom ircd service
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+SERVICES="cr ws sv"
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/cr ] && . /etc/sysconfig/cr
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+	if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+		msg_network_down cr
+		exit 1
+	fi
+else
+	exit 0
+fi
+
+start() {
+	# Check if the service is already running?
+	if [ ! -f /var/lock/subsys/cr ]; then
+		msg_starting "Conference Room IRCD"
+		daemon /usr/lib/cr/programs/launcher /usr/lib/cr $SERVICES
+		RETVAL=$?
+		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/cr
+	else
+		msg_already_running "Conference Room IRCD"
+	fi
+}
+
+stop() {
+	if [ -f /var/lock/subsys/cr ]; then
+		# Stop daemons.
+		msg_stopping "Conference Room IRCD"
+		cd /usr/lib/cr
+		/usr/lib/cr/programs/ConfRoom -stop
+		rc=$?
+		/usr/lib/cr/programs/WMws -stop
+		rc=$((rc + $?))
+		[ "$rc" = 0 ] && ok || fail
+		rm -f /var/lock/subsys/cr
+	else
+		msg_not_running "Conference Room IRCD"
+	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
+	;;
+  restart)
+	stop
+	start
+	exit $?
+	;;
+  status)
+	status cr
+	RETVAL=$?
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|status}"
+	exit 3
+esac
+
+exit $RETVAL
================================================================


More information about the pld-cvs-commit mailing list