]> git.pld-linux.org Git - packages/cyrus-imapd.git/commitdiff
- created by Eero Hänninen (eero.hanninen at delfi.ee)
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 21 Feb 2008 11:29:08 +0000 (11:29 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    cyrus-sync.init -> 1.1

cyrus-sync.init [new file with mode: 0644]

diff --git a/cyrus-sync.init b/cyrus-sync.init
new file mode 100644 (file)
index 0000000..a52ab16
--- /dev/null
@@ -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
This page took 0.627311 seconds and 4 git commands to generate.