diff options
author | laforge <laforge> | 2004-06-12 18:02:13 +0000 |
---|---|---|
committer | laforge <laforge> | 2004-06-12 18:02:13 +0000 |
commit | 478eca4243d11329e1943323d6b1eab96d2d3df2 (patch) | |
tree | d93e3122ea636b626188278d42c8ac1bb18d7859 /ulogd.c | |
parent | a3c7d72c3531cfdf2e35e1c0bac5ca2fc430c5ab (diff) |
actually call init() and fini() functions of plugins (Martin Josefsson)
Diffstat (limited to 'ulogd.c')
-rw-r--r-- | ulogd.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -554,12 +554,20 @@ static config_entry_t rmem_ce = { &loglevel_ce, "rmem", CONFIG_TYPE_INT, static void sigterm_handler(int signal) { + ulog_output_t *p; + ulogd_log(ULOGD_NOTICE, "sigterm received, exiting\n"); ipulog_destroy_handle(libulog_h); free(libulog_buf); if (logfile != stdout) fclose(logfile); + + for (p = ulogd_outputs; p; p = p->next) { + if (p->fini) + (*p->fini)(); + } + exit(0); } @@ -617,6 +625,7 @@ int main(int argc, char* argv[]) uid_t uid = 0; gid_t gid = 0; ulog_packet_msg_t *upkt; + ulog_output_t *p; while ((argch = getopt_long(argc, argv, "c:dh::Vu:", opts, NULL)) != -1) { @@ -727,6 +736,11 @@ int main(int argc, char* argv[]) logfile_open(logf_ce.u.string); + for (p = ulogd_outputs; p; p = p->next) { + if (p->init) + (*p->init)(); + } + #ifdef DEBUG /* dump key and interpreter hash */ interh_dump(); |