mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
exclude race condition when one instance is in wait4done after success kill, but another already starting service, so first will sleep forever
This commit is contained in:
parent
6390f54f9f
commit
c2ff64efc4
@ -43,7 +43,8 @@ start()
|
||||
|
||||
echo -n "Start $PROGRAM service: "
|
||||
|
||||
if isrun; then
|
||||
isrun
|
||||
if [ $? -eq 0 -o -f "$LOCKFILE" ]; then
|
||||
echo -n "already running "
|
||||
EXIT_STATUS=1
|
||||
else
|
||||
@ -78,9 +79,9 @@ stop()
|
||||
|
||||
if isrun; then
|
||||
if [ -f "$LOCKFILE" ]; then
|
||||
rm -f "$LOCKFILE"
|
||||
kill -TERM `cat "$PIDFILE"`
|
||||
wait4done
|
||||
rm -f "$LOCKFILE"
|
||||
else
|
||||
echo "has been stopping already"
|
||||
return 1
|
||||
|
Loading…
Reference in New Issue
Block a user