aboutsummaryrefslogtreecommitdiffstats
path: root/centos/sources/rspamd.init
diff options
context:
space:
mode:
Diffstat (limited to 'centos/sources/rspamd.init')
-rw-r--r--centos/sources/rspamd.init19
1 files changed, 15 insertions, 4 deletions
diff --git a/centos/sources/rspamd.init b/centos/sources/rspamd.init
index 67bfa15ff..3dd3b99be 100644
--- a/centos/sources/rspamd.init
+++ b/centos/sources/rspamd.init
@@ -11,7 +11,7 @@
# Description: Rspamd spam filtering daemon process
### END INIT INFO
#
-# chkconfig: - 85 15
+# chkconfig: - 85 15
# description: rspamd is a spam filtering system
# processname: rspamd
# config: /etc/rspamd/rspamd.conf
@@ -58,11 +58,22 @@ stop() {
if [ "$CONSOLETYPE" != "serial" ]; then
echo -en "\\033[16G"
fi
- while rh_status_q
- do
+ STOPTIMEOUT=30
+ while [ $STOPTIMEOUT -gt 0 ]; do
+ rh_status_q || break
sleep 1
- echo -n $"."
+ let STOPTIMEOUT=${STOPTIMEOUT}-1
done
+ if [ $STOPTIMEOUT -eq 0 ]; then
+ echo "Timeout error occurred trying to stop Rspamd. Forcefully stop the remaining processes."
+ killproc $prog -KILL
+ # Sleep forever after SIGKILL being sent (e.g. UNINT SLEEP)
+ while rh_status_q
+ do
+ sleep 1
+ echo -n $"."
+ done
+ fi
rm -f $lockfile
fi
echo