ctdb-scripts: Remove PID file only if it existed
authorMartin Schwenke <martin@meltin.net>
Wed, 21 Oct 2015 03:12:40 +0000 (14:12 +1100)
committerAmitay Isaacs <amitay@samba.org>
Wed, 28 Oct 2015 05:40:27 +0000 (06:40 +0100)
commitb9903d72d3d53376ddca7e2f2f902195307b395c
tree493ee4b9b4e39e5c558865ed6723478268ca59dd
parent0a90ed51245d4a7acb23d22e47ee3fd5b83819b0
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>
ctdb/config/ctdbd_wrapper