]> git.pld-linux.org Git - packages/cyrus-imapd.git/commitdiff
- switch to start-stop-daemon because sync_client is lame to write pid by it's own...
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 22 Feb 2008 12:44:22 +0000 (12:44 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    cyrus-sync.init -> 1.2

cyrus-sync.init

index a52ab16bf84faa1b3d0ad818ba4f1f8d799a8fe7..7149d06acc77b567c0b86c0036305ec8dc5f02ab 100644 (file)
@@ -25,9 +25,9 @@ fi
 
 start() {
        # Check if the service is already running?
-       if [ ! -f /var/lock/subsys/<service> ]; then
+       if [ ! -f /var/lock/subsys/cyrus-sync ]; then
                msg_starting cyrus-sync
-               daemon /usr/lib/cyrus/sync_client -r &
+               start-stop-daemon --start --quiet --exec /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
@@ -44,9 +44,14 @@ 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
+               start-stop-daemon --stop --quiet --name "sync_client"
+               RETVAL=$?
+               if [ $RETVAL -eq 0 ]; then
+                       rm -f /var/lock/subsys/cyrus-sync
+                       ok
+               else
+                       fail
+               fi
        else
                msg_not_running cyrus-sync
        fi
@@ -56,17 +61,17 @@ RETVAL=0
 # See how we were called.
 case "$1" in
   start)
-       start
+       start
        ;;
   stop)
-       stop
+       stop
        ;;
   restart|force-reload)
        stop
        start
        ;;
   status)
-       status <service>
+       status cyrus-sync
        RETVAL=$?
        ;;
   *)
This page took 0.084906 seconds and 4 git commands to generate.