1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

ctdb-scripts: Remove PID file only if it existed

If 2 attempts are made to start CTDB in quick succession then it is
possible for the 2nd attempt to remove a newly created PID file from
the 1st.

If the PID file existed then the PID/SID from ctdbd_is_running() will
be passed to kill_ctdbd().  If the PID file did not exist then there
is no point removing it.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2015-10-21 14:12:40 +11:00 committed by Amitay Isaacs
parent 0a90ed5124
commit b9903d72d3

View File

@ -148,8 +148,8 @@ kill_ctdbd ()
if [ -n "$_session" ] ; then
pkill -9 -s "$_session" 2>/dev/null
rm -f "$pidfile"
fi
rm -f "$pidfile"
}
############################################################