mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32: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: "
|
echo -n "Start $PROGRAM service: "
|
||||||
|
|
||||||
if isrun; then
|
isrun
|
||||||
|
if [ $? -eq 0 -o -f "$LOCKFILE" ]; then
|
||||||
echo -n "already running "
|
echo -n "already running "
|
||||||
EXIT_STATUS=1
|
EXIT_STATUS=1
|
||||||
else
|
else
|
||||||
@ -78,9 +79,9 @@ stop()
|
|||||||
|
|
||||||
if isrun; then
|
if isrun; then
|
||||||
if [ -f "$LOCKFILE" ]; then
|
if [ -f "$LOCKFILE" ]; then
|
||||||
rm -f "$LOCKFILE"
|
|
||||||
kill -TERM `cat "$PIDFILE"`
|
kill -TERM `cat "$PIDFILE"`
|
||||||
wait4done
|
wait4done
|
||||||
|
rm -f "$LOCKFILE"
|
||||||
else
|
else
|
||||||
echo "has been stopping already"
|
echo "has been stopping already"
|
||||||
return 1
|
return 1
|
||||||
|
Loading…
Reference in New Issue
Block a user