enhance reload_config to correctly re-initialize the logging subsystem.

This includes reopening the log file (in append mode).
Also switching from syslog to logfile and visa versa are included
when called from the SIGHUP handler.

Michael
This commit is contained in:
Michael Adam 2009-12-23 00:18:31 +01:00
parent c4b9454807
commit fb2e65f40b

View File

@ -325,14 +325,23 @@ static void initialize_config_defaults (struct config_s *conf)
/**
* convenience wrapper around reload_config_file
* that also re-initializes logging.
*/
int reload_config (void)
{
int ret;
shutdown_logging ();
ret = reload_config_file (config_defaults.config_file, &config,
&config_defaults);
if (ret != 0) {
goto done;
}
ret = setup_logging ();
done:
return ret;
}