]> git.pld-linux.org Git - packages/rsync.git/blobdiff - rsync.init
- release 4 (by relup.sh)
[packages/rsync.git] / rsync.init
index 53e2a676a3d6467e17f0b5266fe231f729f66292..6f0ba5ef530809c5650e9b7ad1b6cf2276dd5788 100644 (file)
@@ -31,7 +31,7 @@ start() {
        # Start daemons.
        if [ ! -f /var/lock/subsys/rsyncd ]; then
                msg_starting rsyncd
-               daemon rsync --daemon ${RSYNC_OPTIONS}
+               daemon /usr/bin/rsync --daemon --dparam=pidfile=/var/run/rsync.pid ${RSYNC_OPTIONS}
                RETVAL=$?
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/rsyncd
        else
@@ -50,6 +50,16 @@ stop() {
        fi
 }
 
+condrestart() {
+       if [ -f /var/lock/subsys/rsyncd ]; then
+               stop
+               start
+       else
+               msg_not_running rsyncd
+               RETVAL=$1
+       fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -59,16 +69,22 @@ case "$1" in
   stop)
        stop
        ;;
-  restart|force-restart|force-reload)
+  restart)
        stop
        start
        ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
+       ;;
   status)
        status rsyncd rsync
        exit $?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|force-restart|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
        exit 3
 esac
 
This page took 0.115587 seconds and 4 git commands to generate.