SOURCES: cyrus-sync.init (NEW) - created by Eero Hänninen (eero.h...

glen glen at pld-linux.org
Thu Feb 21 12:29:13 CET 2008


Author: glen                         Date: Thu Feb 21 11:29:13 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- created by Eero Hänninen (eero.hanninen at delfi.ee)

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

---- Diffs:

================================================================
Index: SOURCES/cyrus-sync.init
diff -u /dev/null SOURCES/cyrus-sync.init:1.1
--- /dev/null	Thu Feb 21 12:29:13 2008
+++ SOURCES/cyrus-sync.init	Thu Feb 21 12:29:08 2008
@@ -0,0 +1,77 @@
+#!/bin/sh
+#
+# cyrus-sync	cyrus-sync Cyrus replication service
+#
+# chkconfig:	345 85 15
+#
+# description:	cyrus-imap replication service
+#
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# 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 cyrus-sync
+		exit 1
+	fi
+else
+	exit 0
+fi
+
+start() {
+	# Check if the service is already running?
+	if [ ! -f /var/lock/subsys/<service> ]; then
+		msg_starting cyrus-sync
+		daemon /usr/lib/cyrus/sync_client -r &
+		if ps -C sync_client >/dev/null 2>&1; then
+			RETVAL=$?
+			[ $RETVAL -eq 0 ] && touch /var/lock/subsys/cyrus-sync
+			ok
+		else
+			fail
+		fi
+	else
+		msg_already_running cyrus-sync
+	fi
+}
+
+stop() {
+	if [ -f /var/lock/subsys/cyrus-sync ]; then
+		# Stop daemons.
+		msg_stopping cyrus-sync
+		killproc sync_client
+		killproc sync_client -TERM
+		rm -f /var/lock/subsys/cyrus-sync
+	else
+		msg_not_running cyrus-sync
+	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
+	;;
+  restart|force-reload)
+	stop
+	start
+	;;
+  status)
+	status <service>
+	RETVAL=$?
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|force-reload|status}"
+	exit 3
+esac
+
+exit $RETVAL
================================================================


More information about the pld-cvs-commit mailing list