summaryrefslogtreecommitdiffstats
path: root/ctdb/server/eventscript.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2009-11-19 11:03:51 +1100
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2009-11-19 11:03:51 +1100
commitae209c74c8055f1145a43d750e3687c016c4ad7c (patch)
treeb8ae294ac323176395ff9c456e0f2a36f321cfd2 /ctdb/server/eventscript.c
parentcc2d81a77cf827e93aebb6152ba22e179ed66d20 (diff)
downloadsamba-ae209c74c8055f1145a43d750e3687c016c4ad7c.tar.gz
samba-ae209c74c8055f1145a43d750e3687c016c4ad7c.tar.xz
samba-ae209c74c8055f1145a43d750e3687c016c4ad7c.zip
dont reset the event script context everytime we start a new "ctdb eventscript ..."
command. Use the existing context used for non-monitor events Multiple concurrent uses of "ctdb eventscript ..." could otherwise lead to a SEGV (This used to be ctdb commit 80a8d728e9680040e00d24361dfc9367dd372a56)
Diffstat (limited to 'ctdb/server/eventscript.c')
-rw-r--r--ctdb/server/eventscript.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/ctdb/server/eventscript.c b/ctdb/server/eventscript.c
index 7ad66c6c6d..3514c32182 100644
--- a/ctdb/server/eventscript.c
+++ b/ctdb/server/eventscript.c
@@ -952,7 +952,7 @@ struct eventscript_callback_state {
};
/*
- called when takeip event finishes
+ called when a forced eventscript run has finished
*/
static void run_eventscripts_callback(struct ctdb_context *ctdb, int status,
void *private_data)
@@ -985,14 +985,11 @@ int32_t ctdb_run_eventscripts(struct ctdb_context *ctdb,
int ret;
struct eventscript_callback_state *state;
- /* kill off any previous invokations of forced eventscripts */
- if (ctdb->eventscripts_ctx) {
- talloc_free(ctdb->eventscripts_ctx);
+ if (ctdb->event_script_ctx == NULL) {
+ ctdb->event_script_ctx = talloc_zero(ctdb, struct ctdb_monitor_status);
}
- ctdb->eventscripts_ctx = talloc_new(ctdb);
- CTDB_NO_MEMORY(ctdb, ctdb->eventscripts_ctx);
- state = talloc(ctdb->eventscripts_ctx, struct eventscript_callback_state);
+ state = talloc(ctdb->event_script_ctx, struct eventscript_callback_state);
CTDB_NO_MEMORY(ctdb, state);
state->c = talloc_steal(state, c);