SOURCES: atheme.init (NEW) - added

aredridel aredridel at pld-linux.org
Tue Apr 24 01:44:48 CEST 2007


Author: aredridel                    Date: Mon Apr 23 23:44:48 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- added

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

---- Diffs:

================================================================
Index: SOURCES/atheme.init
diff -u /dev/null SOURCES/atheme.init:1.1
--- /dev/null	Tue Apr 24 01:44:48 2007
+++ SOURCES/atheme.init	Tue Apr 24 01:44:43 2007
@@ -0,0 +1,112 @@
+#!/bin/sh
+#
+# atheme	atheme IRC Services
+#
+# chkconfig:	345 85 15
+# description:	atheme is an IRC services daemon.
+#
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Get service config
+[ -f /etc/sysconfig/atheme ] && . /etc/sysconfig/atheme
+
+# 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 atheme
+		exit 1
+	fi
+else
+	exit 0
+fi
+
+start() {
+	daemon --user atheme atheme  --logfile /var/log/atheme/atheme.log
+	RETVAL=$?
+	if [ $RETVAL -eq 0 ]; then
+		touch /var/lock/subsys/atheme
+	fi
+	return $RETVAL
+}
+
+stop() {
+	killproc --pidfile /var/run/atheme.pid atheme
+	rm -f /var/lock/subsys/atheme >/dev/null 2>&1
+}
+
+reload() {
+	# sending INT signal will make atheme close all listening sockets and
+	# wait for client connections to terminate.
+	killproc --pidfile /var/run/atheme.pid atheme -HUP
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+	# Check if the service is already running?
+	if [ ! -f /var/lock/subsys/atheme ]; then
+		msg_starting atheme
+		start
+	else
+		msg_already_running atheme
+	fi
+	;;
+  stop)
+	# Stop daemons.
+	if [ -f /var/lock/subsys/atheme ]; then
+		msg_stopping atheme
+		stop
+	else
+		msg_not_running atheme
+	fi
+	;;
+  status)
+	status atheme
+	RETVAL=$?
+	;;
+  restart)
+	if [ -f /var/lock/subsys/atheme ]; then
+		msg_stopping atheme
+		stop
+		msg_starting atheme
+		start
+		RETVAL=$?
+	else
+		msg_not_running atheme
+		msg_starting atheme
+		start
+	fi
+	;;
+  reload|graceful|force-reload)
+	if [ -f /var/lock/subsys/atheme ]; then
+		msg_reloading atheme
+		reload
+		RETVAL=$?
+	else
+		msg_not_running atheme
+		RETVAL=7
+	fi
+	;;
+  flush-logs)
+	if [ -f /var/lock/subsys/atheme ]; then
+		nls "Rotating %s logs" atheme
+		killproc --pidfile /var/run/atheme.pid atheme -HUP
+		RETVAL=$?
+	else
+		msg_not_running atheme
+		RETVAL=7
+	fi
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|reload|force-reload|graceful|flush-logs|status}"
+	exit 3
+	;;
+esac
+
+exit $RETVAL
================================================================


More information about the pld-cvs-commit mailing list