|
|
@@ -15,6 +15,18 @@
|
|
|
rsync_cfgfile="@l_prefix@/etc/rsync/rsync.conf"
|
|
|
rsync_logfile="@l_prefix@/var/rsync/rsync.log"
|
|
|
rsync_pidfile="@l_prefix@/var/rsync/rsync.pid"
|
|
|
+ rsync_signal () {
|
|
|
+ [ -f $rsync_pidfile ] && kill -$1 `cat $rsync_pidfile`
|
|
|
+ }
|
|
|
+
|
|
|
+%status -p 200 -u @l_susr@ -o
|
|
|
+ rsync_usable="unknown"
|
|
|
+ rsync_active="no"
|
|
|
+ opServiceEnabled rsync && \
|
|
|
+ rsync_signal 0 && rsync_active="yes"
|
|
|
+ echo "rsync_enable=\"$rsync_enable\""
|
|
|
+ echo "rsync_usable=\"$rsync_usable\""
|
|
|
+ echo "rsync_active=\"$rsync_active\""
|
|
|
|
|
|
%start -p 200 -u @l_susr@
|
|
|
opServiceEnabled rsync || exit 0
|
|
|
@@ -23,16 +35,14 @@
|
|
|
|
|
|
%stop -p 200 -u @l_susr@
|
|
|
opServiceEnabled rsync || exit 0
|
|
|
- if [ -f $rsync_pidfile ]; then
|
|
|
- kill -TERM `cat $rsync_pidfile`
|
|
|
- fi
|
|
|
+ rsync_signal TERM
|
|
|
+ # rsync removes the pidfile itself
|
|
|
+ # rm -f $rsync_pidfile 2>/dev/null || true
|
|
|
|
|
|
%restart -u @l_susr@
|
|
|
opServiceEnabled rsync || exit 0
|
|
|
- if [ -f $rsync_pidfile ]; then
|
|
|
- kill -TERM `cat $rsync_pidfile`
|
|
|
- sleep 2
|
|
|
- fi
|
|
|
+ rsync_signal TERM
|
|
|
+ sleep 2
|
|
|
nice -n $rsync_nicelevel @l_prefix@/bin/rsync $rsync_flags \
|
|
|
--daemon --config=$rsync_cfgfile
|
|
|
|