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>
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) {