Browse Source

%status and pidfile handling

master
Michael van Elst 23 years ago committed by Ralf S. Engelschall
parent
commit
00357b4427
  1. 20
      smtpfeed/rc.smtpfeed

20
smtpfeed/rc.smtpfeed

@ -30,6 +30,9 @@
smtpfeed_args="$smtpfeed_args -c ${smtpfeed_hostname:-localhost}"
smtpfeed_args="$smtpfeed_args -r 1 -R ${smtpfeed_maxrcpt:-100}"
smtpfeed_args="$smtpfeed_args -s ${smtpfeed_maxsize:-4194304}"
smtpfeed_signal () {
[ -f $smtpfeed_pidfile ] && kill -TERM `cat $smtpfeed_pidfile`
}
smtpfeed_start () {
( @l_prefix@/sbin/smtpfeedd ${smtpfeed_bind_local:-127.0.0.1:2525} \
@l_prefix@/sbin/smtpfeed ${smtpfeed_args} \
@ -38,12 +41,19 @@
) </dev/null >/dev/null 2>&1
}
smtpfeed_stop () {
if [ -f ${smtpfeed_pidfile} ]; then
kill -TERM `cat ${smtpfeed_pidfile}`
sleep 1
fi
smtpfeed_signal TERM
rm -f $smtpfeed_pidfile 2>/dev/null || true
}
%status -p 200 -u @l_susr@ -o
smtpfeed_usable="unknown"
smtpfeed_active="no"
rcService smtpfeed enable yes && \
smtpfeed_signal 0 && smtpfeed_active="yes"
echo "smtpfeed_enable=\"$smtpfeed_enable\""
echo "smtpfeed_usable=\"$smtpfeed_usable\""
echo "smtpfeed_active=\"$smtpfeed_active\""
%start -p 200 -u @l_susr@
rcService smtpfeed enable yes || exit 0
smtpfeed_start
@ -55,7 +65,7 @@
%restart -u @l_susr@
rcService smtpfeed enable yes || exit 0
smtpfeed_stop
sleep 1
sleep 2
smtpfeed_start
%daily -u @l_susr@

Loading…
Cancel
Save