ctdb-scripts: ctdbd_wrapper should never remove the PID file
authorMartin Schwenke <martin@meltin.net>
Mon, 10 Oct 2016 02:16:01 +0000 (13:16 +1100)
committerStefan Metzmacher <metze@samba.org>
Mon, 24 Oct 2016 08:56:10 +0000 (10:56 +0200)
commitba1356d7bac51d65818a7842d190689645504dca
tree3d01e297fde56e2c3d0b24aa5a791a83d2e56854
parent0708007457141eb9ddb05966b9c03288e35eede0
ctdb-scripts: ctdbd_wrapper should never remove the PID file

kill_ctdbd() kills the daemon and then removes the PID file.  This is
racy because a new daemon could write a new PID file in between the
kill and the removal.  Reversing these steps would be an improvement.

However, none of the places where kill_ctdbd() is called is a safe
place to remove the PID file.  There is always a chance that a new
daemon could start, write a new PID file and then kill_ctdbd() could
remove the new PID file.

ctdbd is able to overwrite a stale PID file by checking to see if it
is locked.

Therefore, entirely drop removal of the PID file from ctdbd_wrapper.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12287

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 56d526c6ea3150a19dd0762b45d23a7c5f96d260)
ctdb/config/ctdbd_wrapper