move config reload message to reload_config()

move it to before disabling logging, so a message with the correct
timestamp is printed if logging was already enabled.
also add a message when loading finished, so one can see from the
timestamp how long it took.

note that this only works on a real config reload triggered by
SIGHUP/SIGUSR1, because on startup we don't know yet where to log to.
This commit is contained in:
rofl0r 2020-09-16 17:04:05 +01:00
parent 683a354196
commit bad36cd9cd
2 changed files with 3 additions and 2 deletions

View File

@ -493,8 +493,6 @@ int reload_config_file (const char *config_fname, struct config_s *conf)
{ {
int ret; int ret;
log_message (LOG_NOTICE, "Reloading config file");
initialize_config_defaults (conf); initialize_config_defaults (conf);
ret = load_config_file (config_fname, conf); ret = load_config_file (config_fname, conf);

View File

@ -257,6 +257,8 @@ int reload_config (int reload_logging)
int ret; int ret;
struct config_s *c_next = get_next_config(); struct config_s *c_next = get_next_config();
log_message (LOG_NOTICE, "Reloading config file");
if (reload_logging) shutdown_logging (); if (reload_logging) shutdown_logging ();
ret = reload_config_file (config_file, c_next); ret = reload_config_file (config_file, c_next);
@ -269,6 +271,7 @@ int reload_config (int reload_logging)
config = c_next; config = c_next;
if (reload_logging) ret = setup_logging (); if (reload_logging) ret = setup_logging ();
log_message (LOG_NOTICE, "Reloading config file finished");
done: done:
return ret; return ret;