The stop function of plugin was not called when ulogd2 was preparing to quit. This patch adds a call to stop for all plugins in each stack and free pluginstance. Signed-off-by: Eric Leblond <eric@xxxxxx> --- src/ulogd.c | 26 +++++++++++++++++++++++++- 1 files changed, 25 insertions(+), 1 deletions(-) diff --git a/src/ulogd.c b/src/ulogd.c index ead35b5..d193b26 100644 --- a/src/ulogd.c +++ b/src/ulogd.c @@ -958,18 +958,42 @@ static void deliver_signal_pluginstances(int signal) } } +static void stop_pluginstances() +{ + struct ulogd_pluginstance_stack *stack; + struct ulogd_pluginstance *pi, *npi; + + llist_for_each_entry(stack, &ulogd_pi_stacks, stack_list) { + llist_for_each_entry_safe(pi, npi, &stack->list, list) { + if (((pi->plugin->priv_size == 0) || pi->private[0]) + && *pi->plugin->stop) { + ulogd_log(ULOGD_DEBUG, "calling stop for %s\n", + pi->plugin->name); + (*pi->plugin->stop)(pi); + pi->private[0] = 0; + } + free(pi); + } + } +} + static void sigterm_handler(int signal) { - + ulogd_log(ULOGD_NOTICE, "sigterm received, exiting\n"); deliver_signal_pluginstances(signal); + stop_pluginstances(); + if (logfile != NULL && logfile != stdout) { fclose(logfile); logfile = NULL; } + if (ulogd_logfile) + free(ulogd_logfile); + exit(0); } -- 1.5.6.3 -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html