X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fexec.c;h=b7be4c7a809b86159cffbc805b3f797e70355df9;hb=107a919d0d15d51d774c92ac72879d869e0fa4ee;hp=fa0196b3470a85b01fc309fde54973945c17245e;hpb=838af4cdc6c8674ed3e14a95fea172118c707a85;p=collectd.git diff --git a/src/exec.c b/src/exec.c index fa0196b3..b7be4c7a 100644 --- a/src/exec.c +++ b/src/exec.c @@ -22,162 +22,265 @@ #include "collectd.h" #include "common.h" #include "plugin.h" +#include "utils_cmd_putval.h" #include #include +#include +#include #include +#define PL_NORMAL 0x01 +#define PL_NOTIF_ACTION 0x02 +#define PL_NAGIOS_PLUGIN 0x04 + +#define PL_RUNNING 0x10 + /* * Private data types */ +/* + * Access to this structure is serialized using the `pl_lock' lock and the + * `PL_RUNNING' flag. The execution of notifications is *not* serialized, so + * all functions used to handle notifications MUST NOT write to this structure. + * The `pid' and `status' fields are thus unused if the `PL_NOTIF_ACTION' flag + * is set. + * The `PL_RUNNING' flag is set in `exec_read' and unset in `exec_read_one'. + */ struct program_list_s; typedef struct program_list_s program_list_t; struct program_list_s { char *user; + char *group; char *exec; + char **argv; int pid; + int status; + int flags; program_list_t *next; }; +typedef struct program_list_and_notification_s +{ + program_list_t *pl; + notification_t n; +} program_list_and_notification_t; + /* * Private variables */ -static data_source_t dsrc_counter[1] = -{ - {"value", DS_TYPE_COUNTER, NAN, NAN} -}; - -static data_set_t ds_counter = -{ - "counter", STATIC_ARRAY_SIZE (dsrc_counter), dsrc_counter -}; - -static data_source_t dsrc_gauge[1] = -{ - {"value", DS_TYPE_GAUGE, NAN, NAN} -}; - -static data_set_t ds_gauge = -{ - "gauge", STATIC_ARRAY_SIZE (dsrc_gauge), dsrc_gauge -}; - -static const char *config_keys[] = -{ - "Exec" -}; -static int config_keys_num = STATIC_ARRAY_SIZE (config_keys); - static program_list_t *pl_head = NULL; +static pthread_mutex_t pl_lock = PTHREAD_MUTEX_INITIALIZER; /* * Functions */ -static int exec_config (const char *key, const char *value) +static void sigchld_handler (int signal) /* {{{ */ { - if (strcasecmp ("Exec", key) == 0) + pid_t pid; + int status; + while ((pid = waitpid (-1, &status, WNOHANG)) > 0) { program_list_t *pl; - pl = (program_list_t *) malloc (sizeof (program_list_t)); - if (pl == NULL) - return (1); - memset (pl, '\0', sizeof (program_list_t)); + for (pl = pl_head; pl != NULL; pl = pl->next) + if (pl->pid == pid) + break; + if (pl != NULL) + pl->status = status; + } /* while (waitpid) */ +} /* void sigchld_handler }}} */ + +static int exec_config_exec (oconfig_item_t *ci) /* {{{ */ +{ + program_list_t *pl; + char buffer[128]; + int i; - pl->user = strdup (value); - if (pl->user == NULL) - { - sfree (pl); - return (1); - } + if (ci->children_num != 0) + { + WARNING ("exec plugin: The config option `%s' may not be a block.", + ci->key); + return (-1); + } + if (ci->values_num < 2) + { + WARNING ("exec plugin: The config option `%s' needs at least two " + "arguments.", ci->key); + return (-1); + } + if ((ci->values[0].type != OCONFIG_TYPE_STRING) + || (ci->values[1].type != OCONFIG_TYPE_STRING)) + { + WARNING ("exec plugin: The first two arguments to the `%s' option must " + "be string arguments.", ci->key); + return (-1); + } + + pl = (program_list_t *) malloc (sizeof (program_list_t)); + if (pl == NULL) + { + ERROR ("exec plugin: malloc failed."); + return (-1); + } + memset (pl, '\0', sizeof (program_list_t)); + + if (strcasecmp ("NagiosExec", ci->key) == 0) + pl->flags |= PL_NAGIOS_PLUGIN; + else if (strcasecmp ("NotificationExec", ci->key) == 0) + pl->flags |= PL_NOTIF_ACTION; + else + pl->flags |= PL_NORMAL; + + pl->user = strdup (ci->values[0].value.string); + if (pl->user == NULL) + { + ERROR ("exec plugin: strdup failed."); + sfree (pl); + return (-1); + } + + pl->group = strchr (pl->user, ':'); + if (pl->group != NULL) + { + *pl->group = '\0'; + pl->group++; + } + + pl->exec = strdup (ci->values[1].value.string); + if (pl->exec == NULL) + { + ERROR ("exec plugin: strdup failed."); + sfree (pl->user); + sfree (pl); + return (-1); + } + + pl->argv = (char **) malloc (ci->values_num * sizeof (char *)); + if (pl->argv == NULL) + { + ERROR ("exec plugin: malloc failed."); + sfree (pl->exec); + sfree (pl->user); + sfree (pl); + return (-1); + } + memset (pl->argv, '\0', ci->values_num * sizeof (char *)); + + { + char *tmp = strrchr (ci->values[1].value.string, '/'); + if (tmp == NULL) + strncpy (buffer, ci->values[1].value.string, sizeof (buffer)); + else + strncpy (buffer, tmp + 1, sizeof (buffer)); + buffer[sizeof (buffer) - 1] = '\0'; + } + pl->argv[0] = strdup (buffer); + if (pl->argv[0] == NULL) + { + ERROR ("exec plugin: malloc failed."); + sfree (pl->argv); + sfree (pl->exec); + sfree (pl->user); + sfree (pl); + return (-1); + } - pl->exec = strchr (pl->user, ' '); - if (pl->exec == NULL) + for (i = 1; i < (ci->values_num - 1); i++) + { + if (ci->values[i + 1].type == OCONFIG_TYPE_STRING) { - sfree (pl->user); - sfree (pl); - return (1); + pl->argv[i] = strdup (ci->values[i + 1].value.string); } - while (*pl->exec == ' ') + else { - *pl->exec = '\0'; - pl->exec++; + if (ci->values[i + 1].type == OCONFIG_TYPE_NUMBER) + { + snprintf (buffer, sizeof (buffer), "%lf", + ci->values[i + 1].value.number); + } + else + { + if (ci->values[i + 1].value.boolean) + strncpy (buffer, "true", sizeof (buffer)); + else + strncpy (buffer, "false", sizeof (buffer)); + } + buffer[sizeof (buffer) - 1] = '\0'; + + pl->argv[i] = strdup (buffer); } - if (*pl->exec == '\0') + if (pl->argv[i] == NULL) { - sfree (pl->user); - sfree (pl); - return (1); + ERROR ("exec plugin: strdup failed."); + break; } + } /* for (i) */ - pl->next = pl_head; - pl_head = pl; - } - else + if (i < (ci->values_num - 1)) { + while ((--i) >= 0) + { + sfree (pl->argv[i]); + } + sfree (pl->argv); + sfree (pl->exec); + sfree (pl->user); + sfree (pl); return (-1); } - return (0); -} /* int exec_config */ - -static void submit_counter (const char *type_instance, counter_t value) -{ - value_t values[1]; - value_list_t vl = VALUE_LIST_INIT; - - DEBUG ("type_instance = %s; value = %llu;", type_instance, value); - - values[0].counter = value; + for (i = 0; pl->argv[i] != NULL; i++) + { + DEBUG ("exec plugin: argv[%i] = %s", i, pl->argv[i]); + } - vl.values = values; - vl.values_len = 1; - vl.time = time (NULL); - strcpy (vl.host, hostname_g); - strcpy (vl.plugin, "exec"); - strcpy (vl.plugin_instance, ""); - strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance)); + pl->next = pl_head; + pl_head = pl; - plugin_dispatch_values ("counter", &vl); -} /* void submit_counter */ + return (0); +} /* int exec_config_exec }}} */ -static void submit_gauge (const char *type_instance, gauge_t value) +static int exec_config (oconfig_item_t *ci) /* {{{ */ { - value_t values[1]; - value_list_t vl = VALUE_LIST_INIT; - - DEBUG ("type_instance = %s; value = %lf;", type_instance, value); - - values[0].gauge = value; + int i; - vl.values = values; - vl.values_len = 1; - vl.time = time (NULL); - strcpy (vl.host, hostname_g); - strcpy (vl.plugin, "exec"); - strcpy (vl.plugin_instance, ""); - strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance)); + for (i = 0; i < ci->children_num; i++) + { + oconfig_item_t *child = ci->children + i; + if ((strcasecmp ("Exec", child->key) == 0) + || (strcasecmp ("NagiosExec", child->key) == 0) + || (strcasecmp ("NotificationExec", child->key) == 0)) + exec_config_exec (child); + else + { + WARNING ("exec plugin: Unknown config option `%s'.", child->key); + } + } /* for (i) */ - plugin_dispatch_values ("gauge", &vl); -} /* void submit_counter */ + return (0); +} /* int exec_config }}} */ -static void exec_child (program_list_t *pl) +static void exec_child (program_list_t *pl) /* {{{ */ { int status; int uid; - char *arg0; + int gid; + int egid; struct passwd *sp_ptr; struct passwd sp; - char pwnambuf[2048]; + char nambuf[2048]; + char errbuf[1024]; sp_ptr = NULL; - status = getpwnam_r (pl->user, &sp, pwnambuf, sizeof (pwnambuf), &sp_ptr); + status = getpwnam_r (pl->user, &sp, nambuf, sizeof (nambuf), &sp_ptr); if (status != 0) { - ERROR ("exec plugin: getpwnam_r failed: %s", strerror (status)); + ERROR ("exec plugin: getpwnam_r failed: %s", + sstrerror (errno, errbuf, sizeof (errbuf))); exit (-1); } if (sp_ptr == NULL) @@ -187,147 +290,356 @@ static void exec_child (program_list_t *pl) } uid = sp.pw_uid; + gid = sp.pw_gid; if (uid == 0) { ERROR ("exec plugin: Cowardly refusing to exec program as root."); exit (-1); } - status = setuid (uid); + /* The group configured in the configfile is set as effective group, because + * this way the forked process can (re-)gain the user's primary group. */ + egid = -1; + if (NULL != pl->group) + { + if ('\0' != *pl->group) { + struct group *gr_ptr = NULL; + struct group gr; + + status = getgrnam_r (pl->group, &gr, nambuf, sizeof (nambuf), &gr_ptr); + if (0 != status) + { + ERROR ("exec plugin: getgrnam_r failed: %s", + sstrerror (errno, errbuf, sizeof (errbuf))); + exit (-1); + } + if (NULL == gr_ptr) + { + ERROR ("exec plugin: No such group: `%s'", pl->group); + exit (-1); + } + + egid = gr.gr_gid; + } + else + { + egid = gid; + } + } /* if (pl->group == NULL) */ + + status = setgid (gid); if (status != 0) { - ERROR ("exec plugin: setuid failed: %s", strerror (errno)); + ERROR ("exec plugin: setgid (%i) failed: %s", + gid, sstrerror (errno, errbuf, sizeof (errbuf))); exit (-1); } - arg0 = strrchr (pl->exec, '/'); - if (arg0 != NULL) - arg0++; - if ((arg0 == NULL) || (*arg0 == '\0')) - arg0 = pl->exec; + if (egid != -1) + { + status = setegid (egid); + if (status != 0) + { + ERROR ("exec plugin: setegid (%i) failed: %s", + egid, sstrerror (errno, errbuf, sizeof (errbuf))); + exit (-1); + } + } - status = execlp (pl->exec, arg0, (char *) 0); + status = setuid (uid); + if (status != 0) + { + ERROR ("exec plugin: setuid (%i) failed: %s", + uid, sstrerror (errno, errbuf, sizeof (errbuf))); + exit (-1); + } - ERROR ("exec plugin: exec failed: %s", strerror (errno)); + status = execvp (pl->exec, pl->argv); + + ERROR ("exec plugin: exec failed: %s", + sstrerror (errno, errbuf, sizeof (errbuf))); exit (-1); -} /* void exec_child */ +} /* void exec_child }}} */ -static int fork_child (program_list_t *pl) +/* + * Creates two pipes (one for reading, ong for writing), forks a child, sets up + * the pipes so that fd_in is connected to STDIN of the child and fd_out is + * connected to STDOUT and STDERR of the child. Then is calls `exec_child'. + */ +static int fork_child (program_list_t *pl, int *fd_in, int *fd_out) /* {{{ */ { - int fd_pipe[2]; + int fd_pipe_in[2]; + int fd_pipe_out[2]; int status; + int pid; if (pl->pid != 0) return (-1); - status = pipe (fd_pipe); + status = pipe (fd_pipe_in); if (status != 0) { - ERROR ("exec plugin: pipe failed: %s", strerror (errno)); + char errbuf[1024]; + ERROR ("exec plugin: pipe failed: %s", + sstrerror (errno, errbuf, sizeof (errbuf))); return (-1); } - pl->pid = fork (); - if (pl->pid < 0) + status = pipe (fd_pipe_out); + if (status != 0) + { + char errbuf[1024]; + ERROR ("exec plugin: pipe failed: %s", + sstrerror (errno, errbuf, sizeof (errbuf))); + return (-1); + } + + pid = fork (); + if (pid < 0) { - ERROR ("exec plugin: fork failed: %s", strerror (errno)); + char errbuf[1024]; + ERROR ("exec plugin: fork failed: %s", + sstrerror (errno, errbuf, sizeof (errbuf))); return (-1); } - else if (pl->pid == 0) + else if (pid == 0) { - close (fd_pipe[0]); + close (fd_pipe_in[1]); + close (fd_pipe_out[0]); - /* Connect the pipe to STDOUT and STDERR */ - if (fd_pipe[1] != STDOUT_FILENO) - dup2 (fd_pipe[1], STDOUT_FILENO); - if (fd_pipe[1] != STDERR_FILENO) - dup2 (fd_pipe[1], STDERR_FILENO); - if ((fd_pipe[1] != STDOUT_FILENO) && (fd_pipe[1] != STDERR_FILENO)) - close (fd_pipe[1]); + /* If the `out' pipe has the filedescriptor STDIN we have to be careful + * with the `dup's below. So, if this is the case we have to handle the + * `out' pipe first. */ + if (fd_pipe_out[1] == STDIN_FILENO) + { + int new_fileno = (fd_pipe_in[0] == STDOUT_FILENO) + ? STDERR_FILENO : STDOUT_FILENO; + dup2 (fd_pipe_out[1], new_fileno); + close (fd_pipe_out[1]); + fd_pipe_out[1] = new_fileno; + } + /* Now `fd_pipe_out[1]' is either `STDOUT' or `STDERR', but definitely not + * `STDIN_FILENO'. */ + + /* Connect the `in' pipe to STDIN */ + if (fd_pipe_in[0] != STDIN_FILENO) + { + dup2 (fd_pipe_in[0], STDIN_FILENO); + close (fd_pipe_in[0]); + fd_pipe_in[0] = STDIN_FILENO; + } + + /* Now connect the `out' pipe to STDOUT and STDERR */ + if (fd_pipe_out[1] != STDOUT_FILENO) + dup2 (fd_pipe_out[1], STDOUT_FILENO); + if (fd_pipe_out[1] != STDERR_FILENO) + dup2 (fd_pipe_out[1], STDERR_FILENO); + + /* If the pipe has some FD that's something completely different, close it + * now. */ + if ((fd_pipe_out[1] != STDOUT_FILENO) && (fd_pipe_out[1] != STDERR_FILENO)) + { + close (fd_pipe_out[1]); + fd_pipe_out[1] = STDOUT_FILENO; + } exec_child (pl); /* does not return */ } - close (fd_pipe[1]); - return (fd_pipe[0]); -} /* int fork_child */ + close (fd_pipe_in[0]); + close (fd_pipe_out[1]); + + if (fd_in != NULL) + *fd_in = fd_pipe_in[1]; + else + close (fd_pipe_in[1]); + + if (fd_out != NULL) + *fd_out = fd_pipe_out[0]; + else + close (fd_pipe_out[0]); + + return (pid); +} /* int fork_child }}} */ + +static int parse_line (char *buffer) /* {{{ */ +{ + char *fields[256]; + int fields_num; + + fields[0] = "PUTVAL"; + fields_num = strsplit (buffer, &fields[1], STATIC_ARRAY_SIZE(fields) - 1); + + handle_putval (stdout, fields, fields_num + 1); + return (0); +} /* int parse_line }}} */ -static void *exec_read_one (void *arg) +static void *exec_read_one (void *arg) /* {{{ */ { program_list_t *pl = (program_list_t *) arg; int fd; FILE *fh; char buffer[1024]; + int status; - fd = fork_child (pl); - if (fd < 0) + status = fork_child (pl, NULL, &fd); + if (status < 0) pthread_exit ((void *) 1); + pl->pid = status; assert (pl->pid != 0); fh = fdopen (fd, "r"); if (fh == NULL) { + char errbuf[1024]; ERROR ("exec plugin: fdopen (%i) failed: %s", fd, - strerror (errno)); + sstrerror (errno, errbuf, sizeof (errbuf))); kill (pl->pid, SIGTERM); + pl->pid = 0; close (fd); pthread_exit ((void *) 1); } + buffer[0] = '\0'; while (fgets (buffer, sizeof (buffer), fh) != NULL) { int len; - char *type; - char *type_instance; - char *value; - - DEBUG ("buffer = %s", buffer); len = strlen (buffer); - if (len < 5) - continue; - if (buffer[0] == '#') - continue; + /* Remove newline from end. */ + while ((len > 0) && ((buffer[len - 1] == '\n') + || (buffer[len - 1] == '\r'))) + buffer[--len] = '\0'; - type = buffer; + DEBUG ("exec plugin: exec_read_one: buffer = %s", buffer); - type_instance = strchr (type, ','); - if (type_instance == NULL) - continue; - *type_instance = '\0'; - type_instance++; + if (pl->flags & PL_NAGIOS_PLUGIN) + break; - if ((strcasecmp ("counter", type) != 0) - && (strcasecmp ("gauge", type) != 0)) - { - WARNING ("exec plugin: Received invalid type: %s", type); - continue; - } + parse_line (buffer); + } /* while (fgets) */ - value = strchr (type_instance, ','); - if (value == NULL) - continue; - *value = '\0'; - value++; + fclose (fh); - DEBUG ("value = %s", value); + if (waitpid (pl->pid, &status, 0) > 0) + pl->status = status; - if (strcasecmp ("counter", type) == 0) - submit_counter (type_instance, atoll (value)); - else - submit_gauge (type_instance, atof (value)); - } /* while (fgets) */ + DEBUG ("exec plugin: Child %i exited with status %i.", + (int) pl->pid, pl->status); + + if (pl->flags & PL_NAGIOS_PLUGIN) + { + notification_t n; + + memset (&n, '\0', sizeof (n)); + + n.severity = NOTIF_FAILURE; + if (pl->status == 0) + n.severity = NOTIF_OKAY; + else if (pl->status == 1) + n.severity = NOTIF_WARNING; + + strncpy (n.message, buffer, sizeof (n.message)); + n.message[sizeof (n.message) - 1] = '\0'; + + n.time = time (NULL); + + strncpy (n.host, hostname_g, sizeof (n.host)); + n.host[sizeof (n.host) - 1] = '\0'; + + plugin_dispatch_notification (&n); + } - fclose (fh); pl->pid = 0; + pthread_mutex_lock (&pl_lock); + pl->flags &= ~PL_RUNNING; + pthread_mutex_unlock (&pl_lock); + pthread_exit ((void *) 0); -} /* void *exec_read_one */ + return (NULL); +} /* void *exec_read_one }}} */ -static int exec_read (void) +static void *exec_notification_one (void *arg) /* {{{ */ +{ + program_list_t *pl = ((program_list_and_notification_t *) arg)->pl; + const notification_t *n = &((program_list_and_notification_t *) arg)->n; + int fd; + FILE *fh; + int pid; + int status; + const char *severity; + + pid = fork_child (pl, &fd, NULL); + if (pid < 0) + pthread_exit ((void *) 1); + + fh = fdopen (fd, "w"); + if (fh == NULL) + { + char errbuf[1024]; + ERROR ("exec plugin: fdopen (%i) failed: %s", fd, + sstrerror (errno, errbuf, sizeof (errbuf))); + kill (pl->pid, SIGTERM); + pl->pid = 0; + close (fd); + pthread_exit ((void *) 1); + } + + severity = "FAILURE"; + if (n->severity == NOTIF_WARNING) + severity = "WARNING"; + else if (n->severity == NOTIF_OKAY) + severity = "OKAY"; + + fprintf (fh, "Severity: %s\n" + "Time: %u\n" + "Message: %s\n", + severity, (unsigned int) n->time, n->message); + + /* Print the optional fields */ + if (strlen (n->host) > 0) + fprintf (fh, "Host: %s\n", n->host); + if (strlen (n->plugin) > 0) + fprintf (fh, "Plugin: %s\n", n->plugin); + if (strlen (n->plugin_instance) > 0) + fprintf (fh, "PluginInstance: %s\n", n->plugin_instance); + if (strlen (n->type) > 0) + fprintf (fh, "Type: %s\n", n->type); + if (strlen (n->type_instance) > 0) + fprintf (fh, "TypeInstance: %s\n", n->type_instance); + + /* Newline signalling end of data */ + fprintf (fh, "\n"); + + fflush (fh); + fclose (fh); + + waitpid (pid, &status, 0); + + DEBUG ("exec plugin: Child %i exited with status %i.", + pid, status); + + sfree (arg); + pthread_exit ((void *) 0); + return (NULL); +} /* void *exec_notification_one }}} */ + +static int exec_init (void) /* {{{ */ +{ + struct sigaction sa; + + memset (&sa, '\0', sizeof (sa)); + sa.sa_handler = sigchld_handler; + sigaction (SIGCHLD, &sa, NULL); + + return (0); +} /* int exec_init }}} */ + +static int exec_read (void) /* {{{ */ { program_list_t *pl; @@ -336,25 +648,100 @@ static int exec_read (void) pthread_t t; pthread_attr_t attr; - if (pl->pid != 0) + /* Only execute `normal' and `nagios' style executables here. */ + if ((pl->flags & (PL_NAGIOS_PLUGIN | PL_NORMAL)) == 0) continue; + pthread_mutex_lock (&pl_lock); + /* Skip if a child is already running. */ + if ((pl->flags & PL_RUNNING) != 0) + { + pthread_mutex_unlock (&pl_lock); + continue; + } + pl->flags |= PL_RUNNING; + pthread_mutex_unlock (&pl_lock); + pthread_attr_init (&attr); pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); pthread_create (&t, &attr, exec_read_one, (void *) pl); } /* for (pl) */ return (0); -} /* int exec_read */ +} /* int exec_read }}} */ + +static int exec_notification (const notification_t *n) +{ + program_list_t *pl; + program_list_and_notification_t *pln; + + for (pl = pl_head; pl != NULL; pl = pl->next) + { + pthread_t t; + pthread_attr_t attr; + + /* Only execute `notification' style executables here. */ + if ((pl->flags & PL_NOTIF_ACTION) == 0) + continue; + + /* Skip if a child is already running. */ + if (pl->pid != 0) + continue; + + pln = (program_list_and_notification_t *) malloc (sizeof + (program_list_and_notification_t)); + if (pln == NULL) + { + ERROR ("exec plugin: malloc failed."); + continue; + } + + pln->pl = pl; + memcpy (&pln->n, n, sizeof (notification_t)); + + pthread_attr_init (&attr); + pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); + pthread_create (&t, &attr, exec_notification_one, (void *) pln); + } /* for (pl) */ + + return (0); +} /* int exec_notification */ + +static int exec_shutdown (void) /* {{{ */ +{ + program_list_t *pl; + program_list_t *next; + + pl = pl_head; + while (pl != NULL) + { + next = pl->next; + + if (pl->pid > 0) + { + kill (pl->pid, SIGTERM); + INFO ("exec plugin: Sent SIGTERM to %hu", (unsigned short int) pl->pid); + } + + sfree (pl->user); + sfree (pl); + + pl = next; + } /* while (pl) */ + pl_head = NULL; + + return (0); +} /* int exec_shutdown }}} */ void module_register (void) { - plugin_register_data_set (&ds_counter); - plugin_register_data_set (&ds_gauge); - plugin_register_config ("exec", exec_config, config_keys, config_keys_num); + plugin_register_complex_config ("exec", exec_config); + plugin_register_init ("exec", exec_init); plugin_register_read ("exec", exec_read); + plugin_register_notification ("exec", exec_notification); + plugin_register_shutdown ("exec", exec_shutdown); } /* void module_register */ /* - * vim:shiftwidth=2:softtabstop=2:tabstop=8 + * vim:shiftwidth=2:softtabstop=2:tabstop=8:fdm=marker */