SOURCES: cr.init (NEW) - save work from 2007-02-28

glen glen at pld-linux.org
Mon Mar 17 06:39:19 CET 2008


Author: glen                         Date: Mon Mar 17 05:39:19 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- save work from 2007-02-28

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

---- Diffs:

================================================================
Index: SOURCES/cr.init
diff -u /dev/null SOURCES/cr.init:1.1
--- /dev/null	Mon Mar 17 06:39:19 2008
+++ SOURCES/cr.init	Mon Mar 17 06:39:13 2008
@@ -0,0 +1,89 @@
+#!/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"
+PROGDIR=/usr/lib/cr
+
+# 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"
+		set -x
+		daemon /usr/lib/cr/programs/launcher /usr/lib/cr $SERVICES
+#		daemon /usr/lib/cr/programs/launcher /etc/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"
+		killproc ConfRoom
+		killproc WMws
+#		set -x
+#		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