state,
ctdb_do_takeip_callback,
state,
- false,
CTDB_EVENT_TAKE_IP,
"%s %s %u",
ctdb_vnn_iface_string(vnn),
state,
ctdb_do_updateip_callback,
state,
- false,
CTDB_EVENT_UPDATE_IP,
"%s %s %s %u",
state->old->name,
ret = ctdb_event_script_callback(ctdb,
state, release_ip_callback, state,
- false,
CTDB_EVENT_RELEASE_IP,
"%s %s %u",
iface,
ret = ctdb_event_script_callback(ctdb,
mem_ctx, delete_ip_callback, mem_ctx,
- false,
CTDB_EVENT_RELEASE_IP,
"%s %s %u",
ctdb_vnn_iface_string(vnn),
ret = ctdb_event_script_callback(ctdb, state,
ctdb_ipreallocated_callback, state,
- false, CTDB_EVENT_IPREALLOCATED,
+ CTDB_EVENT_IPREALLOCATED,
"%s", "");
if (ret != 0) {
struct event_script_callback *callback;
pid_t child;
int fd[2];
- bool from_user;
enum ctdb_eventscript_call call;
const char *options;
struct timeval timeout;
static char *child_command_string(struct ctdb_context *ctdb,
TALLOC_CTX *ctx,
- bool from_user,
const char *scriptname,
enum ctdb_eventscript_call call,
const char *options)
{
- const char *str = from_user ? "CTDB_CALLED_BY_USER=1 " : "";
-
- /* Allow a setting where we run the actual monitor event
- from an external source and replace it with
- a "status" event that just picks up the actual
- status of the event asynchronously.
- */
- if ((ctdb->tunable.use_status_events_for_monitoring != 0)
- && (call == CTDB_EVENT_MONITOR)
- && !from_user) {
- return talloc_asprintf(ctx, "%s%s/%s %s",
- str,
- ctdb->event_script_dir,
- scriptname, "status");
- } else {
- return talloc_asprintf(ctx, "%s%s/%s %s %s",
- str,
- ctdb->event_script_dir,
- scriptname,
- ctdb_eventscript_call_names[call],
- options);
- }
+ return talloc_asprintf(ctx, "%s/%s %s %s",
+ ctdb->event_script_dir,
+ scriptname,
+ ctdb_eventscript_call_names[call],
+ options);
}
static int child_run_one(struct ctdb_context *ctdb,
which allows it to do blocking calls such as system()
*/
static int child_run_script(struct ctdb_context *ctdb,
- bool from_user,
enum ctdb_eventscript_call call,
const char *options,
struct ctdb_script_wire *current)
if (ret != 0)
goto out;
- cmdstr = child_command_string(ctdb, tmp_ctx, from_user,
+ cmdstr = child_command_string(ctdb, tmp_ctx,
current->name, call, options);
CTDB_NO_MEMORY(ctdb, cmdstr);
set_close_on_exec(state->fd[1]);
ctdb_set_process_name("ctdb_eventscript");
- rt = child_run_script(ctdb, state->from_user, state->call, state->options, current);
+ rt = child_run_script(ctdb, state->call, state->options, current);
/* We must be able to write PIPEBUF bytes at least; if this
somehow fails, the read above will be short. */
write(state->fd[1], &rt, sizeof(rt));
const void *mem_ctx,
void (*callback)(struct ctdb_context *, int, void *),
void *private_data,
- bool from_user,
enum ctdb_eventscript_call call,
const char *fmt, va_list ap)
{
state->callback->private_data = private_data;
state->ctdb = ctdb;
- state->from_user = from_user;
state->call = call;
state->options = talloc_vasprintf(state, fmt, ap);
state->timeout = timeval_set(ctdb->tunable.script_timeout, 0);
state->current = 0;
state->child = 0;
- if (!from_user && (call == CTDB_EVENT_MONITOR)) {
+ if (call == CTDB_EVENT_MONITOR) {
ctdb->current_monitor = state;
}
TALLOC_CTX *mem_ctx,
void (*callback)(struct ctdb_context *, int, void *),
void *private_data,
- bool from_user,
enum ctdb_eventscript_call call,
const char *fmt, ...)
{
int ret;
va_start(ap, fmt);
- ret = ctdb_event_script_callback_v(ctdb, mem_ctx, callback, private_data, from_user, call, fmt, ap);
+ ret = ctdb_event_script_callback_v(ctdb, mem_ctx, callback, private_data, call, fmt, ap);
va_end(ap);
return ret;
va_start(ap, fmt);
ret = ctdb_event_script_callback_v(ctdb, ctdb,
- event_script_callback, &status, false, call, fmt, ap);
+ event_script_callback, &status, call, fmt, ap);
va_end(ap);
if (ret != 0) {
return ret;
ret = ctdb_event_script_callback(ctdb,
state, run_eventscripts_callback, state,
- true, call, "%s", options);
+ call, "%s", options);
if (ret != 0) {
ctdb_enable_monitoring(ctdb);