2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-31 01:56:39 +00:00

Merge pull request #1240 from daniceexi/xcatd_stop

issue 1137: waiting longer for stopping xcatd when the system load of…
This commit is contained in:
chenglch 2016-06-01 14:58:19 +08:00
commit 2794ca51b4

View File

@ -103,15 +103,21 @@ stop)
fi
kill -TERM -`cat /var/run/xcatd.pid`
i=0;
while $STATUS > /dev/null 2>&1 && [ $i -lt 15 ]; do
while $STATUS > /dev/null 2>&1 && [ $i -lt 30 ]; do
sleep .1
i=$((i+1))
done
$STATUS > /dev/null 2>&1
if [ "$?" = "0" ]; then
kill -KILL -`cat /var/run/xcatd.pid`
i=0
while $STATUS > /dev/null 2>&1 && [ $i -lt 30 ]; do
sleep .1
i=$((i+1))
done
fi
sleep .1
$STATUS > /dev/null 2>&1
if [ "$?" = "0" ]; then
$LOG_FAILURE