From: Amitay Isaacs Date: Thu, 21 Jun 2018 07:02:09 +0000 (+1000) Subject: ctdb-tools: Switch to using new event daemon tool X-Git-Tag: tevent-0.9.37~100 X-Git-Url: http://git.samba.org/samba.git/?a=commitdiff_plain;h=26b19401622d751a56d9a8df4d4102b5df1f6519;p=bbaumbach%2Fsamba-autobuild%2F.git ctdb-tools: Switch to using new event daemon tool Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- diff --git a/ctdb/tests/simple/60_recoverd_missing_ip.sh b/ctdb/tests/simple/60_recoverd_missing_ip.sh index a993f53e013..215d0942a80 100755 --- a/ctdb/tests/simple/60_recoverd_missing_ip.sh +++ b/ctdb/tests/simple/60_recoverd_missing_ip.sh @@ -39,7 +39,7 @@ try_command_on_node -v all $CTDB ip my_exit_hook () { if [ -z "$TEST_LOCAL_DAEMONS" ] ; then - onnode -q all $CTDB event script enable "10.interface" + onnode -q all $CTDB event script enable legacy "10.interface" fi } @@ -55,7 +55,7 @@ wait_for_monitor_event $test_node if [ -z "$TEST_LOCAL_DAEMONS" ] ; then # Stop monitor events from bringing up the link status of an interface - try_command_on_node $test_node $CTDB event script disable 10.interface + try_command_on_node $test_node $CTDB event script disable legacy 10.interface fi echo "Marking interface $iface down on node $test_node" diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 7881268a9af..30b54e352fd 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -4558,15 +4558,12 @@ static int control_event(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, int argc, const char **argv) { char *t, *event_helper = NULL; - char *eventd_socket = NULL; - const char **new_argv; - int i; t = getenv("CTDB_EVENT_HELPER"); if (t != NULL) { event_helper = talloc_strdup(mem_ctx, t); } else { - event_helper = talloc_asprintf(mem_ctx, "%s/ctdb_event", + event_helper = talloc_asprintf(mem_ctx, "%s/ctdb-event", CTDB_HELPER_BINDIR); } @@ -4575,49 +4572,25 @@ static int control_event(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, return 1; } - t = getenv("CTDB_SOCKET"); - if (t != NULL) { - eventd_socket = talloc_asprintf(mem_ctx, "%s/eventd.sock", - dirname(t)); - } else { - eventd_socket = talloc_asprintf(mem_ctx, "%s/eventd.sock", - CTDB_RUNDIR); - } - - if (eventd_socket == NULL) { - fprintf(stderr, "Unable to set event daemon socket\n"); - return 1; - } - - new_argv = talloc_array(mem_ctx, const char *, argc + 1); - if (new_argv == NULL) { - fprintf(stderr, "Memory allocation error\n"); - return 1; - } - - new_argv[0] = eventd_socket; - for (i=0; i 1) { usage("scriptstatus"); } new_argv[0] = "status"; - new_argv[1] = (argc == 0) ? "monitor" : argv[0]; - new_argv[2] = NULL; + new_argv[1] = "legacy"; + new_argv[2] = (argc == 0) ? "monitor" : argv[0]; + new_argv[3] = NULL; - (void) control_event(mem_ctx, ctdb, 2, new_argv); + (void) control_event(mem_ctx, ctdb, 3, new_argv); return 0; }