rsync: improved rc script
This commit is contained in:
parent
53c69caf35
commit
992a365c3e
@ -1,4 +1,4 @@
|
|||||||
43bd6676f0b404326eee2d63be3cdcfe rsync-3.1.1.tar.gz
|
43bd6676f0b404326eee2d63be3cdcfe rsync-3.1.1.tar.gz
|
||||||
bd6cc8e2c83d5e845af20a30e105fb5f rsync.driver
|
bd6cc8e2c83d5e845af20a30e105fb5f rsync.driver
|
||||||
a71995f22768c931c5649a1336d25ffb rsyncd
|
d20f1ca0fb415a6788808c75170d951a rsyncd
|
||||||
b4e95fa8c8f3ae13cfdf616abd6a3960 rsyncd.conf
|
b4e95fa8c8f3ae13cfdf616abd6a3960 rsyncd.conf
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
name=rsync
|
name=rsync
|
||||||
version=3.1.1
|
version=3.1.1
|
||||||
release=1
|
release=2
|
||||||
source=(http://rsync.samba.org/ftp/$name/src/$name-$version.tar.gz \
|
source=(http://rsync.samba.org/ftp/$name/src/$name-$version.tar.gz \
|
||||||
rsyncd.conf rsyncd rsync.driver)
|
rsyncd.conf rsyncd rsync.driver)
|
||||||
|
|
||||||
|
21
rsync/rsyncd
21
rsync/rsyncd
@ -3,20 +3,33 @@
|
|||||||
# /etc/rc.d/rsyncd: start/stop rsyncd daemon
|
# /etc/rc.d/rsyncd: start/stop rsyncd daemon
|
||||||
#
|
#
|
||||||
|
|
||||||
|
SSD=/sbin/start-stop-daemon
|
||||||
|
PROG=/usr/bin/rsync
|
||||||
|
PID=/var/run/rsyncd.pid
|
||||||
|
OPTS="--daemon"
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
start)
|
start)
|
||||||
/usr/bin/rsync --daemon
|
$SSD --start --pidfile $PID --exec $PROG -- $OPTS
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
kill `cat /var/run/rsyncd.pid`
|
$SSD --stop --retry 10 --pidfile $PID
|
||||||
;;
|
;;
|
||||||
restart)
|
restart)
|
||||||
$0 stop
|
$0 stop
|
||||||
sleep 2
|
|
||||||
$0 start
|
$0 start
|
||||||
;;
|
;;
|
||||||
|
status)
|
||||||
|
$SSD --status --pidfile $PID
|
||||||
|
case $? in
|
||||||
|
0) echo "$PROG is running with pid $(cat $PID)" ;;
|
||||||
|
1) echo "$PROG is not running but the pid file $PID exists" ;;
|
||||||
|
3) echo "$PROG is not running" ;;
|
||||||
|
4) echo "Unable to determine the program status" ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "usage: $0 [start|stop|restart]"
|
echo "usage: $0 [start|stop|restart|status]"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user