summaryrefslogtreecommitdiffstats
path: root/ctdb/server/eventscript.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2009-10-21 16:50:39 +1100
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2009-10-21 16:50:39 +1100
commitd5fd4fc0cecf30db22244c1aa88b8bba9c49df92 (patch)
tree3dccdbd77424dda9e9a6cfad3f158333655c4d5e /ctdb/server/eventscript.c
parenta92ba7f729a4077a26e23e5de80c1cc941866489 (diff)
downloadsamba-d5fd4fc0cecf30db22244c1aa88b8bba9c49df92.tar.gz
samba-d5fd4fc0cecf30db22244c1aa88b8bba9c49df92.tar.xz
samba-d5fd4fc0cecf30db22244c1aa88b8bba9c49df92.zip
During tests it is common to add/delete test eventscripts at runtime.
This can race with teh eventascript handling that does a : list all scripts, sort them, then execute them so trap status code 127 which means the script could not be executed (or /bin/sh does not exist) and treat it as not to cause the node to become unhealthy (This used to be ctdb commit befabc917edb036ca81f5216f65a6d62b26ee83e)
Diffstat (limited to 'ctdb/server/eventscript.c')
-rw-r--r--ctdb/server/eventscript.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ctdb/server/eventscript.c b/ctdb/server/eventscript.c
index e84f1308ec..8a62af9c54 100644
--- a/ctdb/server/eventscript.c
+++ b/ctdb/server/eventscript.c
@@ -593,6 +593,11 @@ static int ctdb_event_script_v(struct ctdb_context *ctdb, const char *options)
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 (is_monitor == 1) {
if (ctdb_ctrl_event_script_stop(ctdb, ret) != 0) {
DEBUG(DEBUG_ERR,(__location__ " Failed to stop event script monitoring\n"));