Skip to content
Snippets Groups Projects
Commit 394e7c6b authored by Stuart Gathman's avatar Stuart Gathman
Browse files

Use /var/run/milter/milter.pid if available.

parent 66314dc6
No related branches found
No related tags found
No related merge requests found
......@@ -46,8 +46,32 @@ start() {
stop() {
# Stop daemons.
echo -n "Shutting down $prog: "
# Find pid.
pid=
base="milter"
if [ -f /var/run/milter/milter.pid ]; then
local line p
read line < /var/run/milter/milter.pid
for p in $line ; do
[ -z "${p//[0-9]/}" -a -d "/proc/$p" ] && pid="$pid $p"
done
fi
if test -n "$pid"; then
checkpid $pid && kill "$pid"
for i in 1 2 3 4 5 6 7 8 9 0; do
checkpid $pid && sleep 2 || break
done
if checkpid $pid; then
failure $"$base shutdown"
RETVAL=1
else
success $"$base shutdown"
RETVAL=0
fi
else
killproc -d 9 milter
RETVAL=$?
fi
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/milter
return $RETVAL
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment