diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2009-12-07 23:09:02 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2009-12-07 23:09:02 +1030 |
commit | ce378014c7836b9ff112aad6a473db19670e0e91 (patch) | |
tree | ffd5dec8804ebe3edc488556913d8c0e5a1bf784 /ctdb/server/eventscript.c | |
parent | 8993d6f523930be4ab08f0716030ab6be66a9ce4 (diff) | |
download | samba-ce378014c7836b9ff112aad6a473db19670e0e91.tar.gz samba-ce378014c7836b9ff112aad6a473db19670e0e91.tar.xz samba-ce378014c7836b9ff112aad6a473db19670e0e91.zip |
eventscript: enhance script delete race check
We currently assume 127 == script removed. The script can also return 127;
best to re-check the execution status in this case (and for 126, which will
happen if the script is non-executable).
If the script is no longer executable/not present, we ignore it.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(This used to be ctdb commit 0a53d6b5ac81daf0efa32f35e7758ede2a5bdb63)
Diffstat (limited to 'ctdb/server/eventscript.c')
-rw-r--r-- | ctdb/server/eventscript.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ctdb/server/eventscript.c b/ctdb/server/eventscript.c index 183e076420..a4292778f1 100644 --- a/ctdb/server/eventscript.c +++ b/ctdb/server/eventscript.c @@ -588,9 +588,13 @@ static int ctdb_run_event_script(struct ctdb_context *ctdb, if (ret != -1) { ret = WEXITSTATUS(ret); } - if (ret == 127) { - ret = 0; - DEBUG(DEBUG_ERR,("Script %s returned status 127. Someone just deleted it?\n", cmdstr)); + if (ret == 127 || ret == 126) { + /* Re-check it... */ + if (!check_executable(ctdb->event_script_dir, + current->name)) { + ret = 0; + DEBUG(DEBUG_ERR,("Script %s returned status 127. Someone just deleted it?\n", cmdstr)); + } } if (!from_user && call == CTDB_EVENT_MONITOR) { |