summaryrefslogtreecommitdiffstats
path: root/syslogd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-08-09 13:44:36 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-08-09 13:44:36 +0000
commitde00dd2a7ea6202c2f154f2e3f4fd54e3cac32cc (patch)
treec22718da0c2e38b6c072f0d495e90adc027615aa /syslogd.c
parent16a59b29b76b6266cfcca3c4aa748f85306b650c (diff)
downloadrsyslog-de00dd2a7ea6202c2f154f2e3f4fd54e3cac32cc.tar.gz
rsyslog-de00dd2a7ea6202c2f154f2e3f4fd54e3cac32cc.tar.xz
rsyslog-de00dd2a7ea6202c2f154f2e3f4fd54e3cac32cc.zip
added module unload functionality; rsyslogd now unloads modules on exit (of
course, with only statically linked modules, there is little current value in this - but it is made towards an upcoming dynaload plugin interface)
Diffstat (limited to 'syslogd.c')
-rw-r--r--syslogd.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/syslogd.c b/syslogd.c
index b74bdb89..9cf51b34 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -3543,6 +3543,22 @@ static void die(int sig)
remove_pid(PidFile);
if(glblHadMemShortage)
dbgprintf("Had memory shortage at least once during the run.\n");
+
+ /* de-init some modules */
+ modExitIminternal();
+
+ /* TODO: this would also be the right place to de-init the builtin output modules. We
+ * do not currently do that, because the module interface does not allow for
+ * it. This will come some time later (it's essential with loadable modules).
+ * For the time being, this is a memory leak on exit, but as the process is
+ * terminated, we do not really bother about it.
+ * rgerhards, 2007-08-03
+ * I have added some code now, but all that mod init/de-init should be moved to
+ * init, so that modules are unloaded and reloaded on HUP to. Eventually it should go
+ * into freeSelectors() - but that needs to be seen. -- rgerhards, 2007-08-09
+ */
+ modUnloadAndDestructAll();
+
dbgprintf("Clean shutdown completed, bye.\n");
exit(0); /* "good" exit, this is the terminator function for rsyslog [die()] */
}
@@ -6173,18 +6189,6 @@ int main(int argc, char **argv)
*/
mainloop();
-
- /* de-init some modules */
- modExitIminternal();
-
- /* TODO: this would also be the right place to de-init the builtin output modules. We
- * do not currently do that, because the module interface does not allow for
- * it. This will come some time later (it's essential with loadable modules).
- * For the time being, this is a memory leak on exit, but as the process is
- * terminated, we do not really bother about it.
- * rgerhards, 2007-08-03
- */
-
/* end de-init's */
die(bFinished);