summaryrefslogtreecommitdiff
path: root/ctdb/config/ctdbd_wrapper
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2016-10-10 13:16:01 +1100
committerVolker Lendecke <vl@samba.org>2016-10-13 14:25:09 +0200
commit56d526c6ea3150a19dd0762b45d23a7c5f96d260 (patch)
treea6a181f0af60eab3af058f748a00ceec46c1f1d8 /ctdb/config/ctdbd_wrapper
parentd7214a82169e777a6432347ad3dbab8013b83194 (diff)
downloadsamba-56d526c6ea3150a19dd0762b45d23a7c5f96d260.tar.gz
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>
Diffstat (limited to 'ctdb/config/ctdbd_wrapper')
-rwxr-xr-xctdb/config/ctdbd_wrapper1
1 files changed, 0 insertions, 1 deletions
diff --git a/ctdb/config/ctdbd_wrapper b/ctdb/config/ctdbd_wrapper
index cdf030499d3..bfc91f7b644 100755
--- a/ctdb/config/ctdbd_wrapper
+++ b/ctdb/config/ctdbd_wrapper
@@ -185,7 +185,6 @@ kill_ctdbd ()
if [ -n "$_session" ] ; then
pkill -9 -s "$_session" 2>/dev/null
- rm -f "$pidfile"
fi
}