Merge pull request #52 from dwhile/patch-1

Race condition on restart
This commit is contained in:
Jerry Benton 2017-04-28 05:08:40 -04:00 committed by GitHub
commit bdabaeee90

View file

@ -219,10 +219,15 @@ do_stop()
rm -f /var/lock/subsys/MailScanner
fi
# remove pid file
if [ -f $PIDFILE ] ; then
rm -f $PIDFILE
fi
s='-\|/';
x=0
i=0
while [ "$x" -lt 400 -a -f $PIDFILE ]; do
x=$((x+1));
i=$(( (i+1) %4 ));
printf "\r${s:$i:1}";
sleep .1;
done
# create stopped file
touch $stopped_lockfile