|
@@ -11,14 +11,50 @@
|
|
|
rdist_log_minsize="1M"
|
|
rdist_log_minsize="1M"
|
|
|
rdist_log_complevel="9"
|
|
rdist_log_complevel="9"
|
|
|
|
|
|
|
|
|
|
+%common
|
|
|
|
|
+ rdist_pidfile="@l_prefix@/var/rdist/rdist.pid"
|
|
|
|
|
+ rdist_cfgfile="@l_prefix@/etc/rdist/rdist.conf"
|
|
|
|
|
+ rdist_signal () {
|
|
|
|
|
+ [ -f $rdist_pidfile ] && kill -$1 `cat $rdist_pidfile`
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+%status -u @l_susr@ -o
|
|
|
|
|
+ rdist_usable="unknown"
|
|
|
|
|
+ rdist_active="no"
|
|
|
|
|
+ rcService rdist enable yes && \
|
|
|
|
|
+ rdist_signal 0 && rdist_active="yes"
|
|
|
|
|
+ echo "rdist_enable=\"$rdist_enable\""
|
|
|
|
|
+ echo "rdist_usable=\"$rdist_usable\""
|
|
|
|
|
+ echo "rdist_active=\"$rdist_active\""
|
|
|
|
|
+
|
|
|
|
|
+%start -u @l_susr@
|
|
|
|
|
+ rcService rdist enable yes || exit 0
|
|
|
|
|
+ rcService rdist active yes && exit 0
|
|
|
|
|
+ @l_prefix@/sbin/rdist -S -D &
|
|
|
|
|
+ echo $! >$rdist_pidfile
|
|
|
|
|
+
|
|
|
|
|
+%stop -u @l_susr@
|
|
|
|
|
+ rcService rdist enable yes || exit 0
|
|
|
|
|
+ rcService rdist active no && exit 0
|
|
|
|
|
+ rdist_signal TERM
|
|
|
|
|
+ rm $rdist_pidfile
|
|
|
|
|
+
|
|
|
|
|
+%restart -u @l_susr@
|
|
|
|
|
+ rcService rdist enable yes || exit 0
|
|
|
|
|
+ rcService rdist active no && exit 0
|
|
|
|
|
+ rc rdist stop
|
|
|
|
|
+ sleep 2
|
|
|
|
|
+ rc rdist start
|
|
|
|
|
+
|
|
|
%daily -u @l_susr@
|
|
%daily -u @l_susr@
|
|
|
rcService rdist enable yes || exit 0
|
|
rcService rdist enable yes || exit 0
|
|
|
|
|
|
|
|
# rotate logfile
|
|
# rotate logfile
|
|
|
shtool rotate -f \
|
|
shtool rotate -f \
|
|
|
-n ${rdist_log_numfiles} -s ${rdist_log_minsize} -d \
|
|
-n ${rdist_log_numfiles} -s ${rdist_log_minsize} -d \
|
|
|
- -z ${rdist_log_complevel} -o @l_rusr@ -g @l_rgrp@ -m 644 \
|
|
|
|
|
|
|
+ -z ${rdist_log_complevel} -o @l_susr@ -g @l_mgrp@ -m 644 \
|
|
|
-P "${rdist_log_prolog}" \
|
|
-P "${rdist_log_prolog}" \
|
|
|
|
|
+ -E "${rdist_log_epilog} && rc rdist restart" \
|
|
|
-E "${rdist_log_epilog}" \
|
|
-E "${rdist_log_epilog}" \
|
|
|
@l_prefix@/var/rdist/rdist.log
|
|
@l_prefix@/var/rdist/rdist.log
|
|
|
|
|
|