From 2990aa5980401fdc818e89a96f4e2d3e0dcc3247 Mon Sep 17 00:00:00 2001 From: Pavel Březina Date: Thu, 2 Aug 2012 13:40:01 +0200 Subject: monitor: set debug level when unable to load configuration https://fedorahosted.org/sssd/ticket/1345 When the monitor is unable to load configuration and non debug level is set (e.g. when sssd is started via 'service'), none message was saved into logs. This patch forces debug messages to be written in this scenario. --- src/monitor/monitor.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/monitor') diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index 1b310766..5751cd01 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -2516,6 +2516,12 @@ int main(int argc, const char *argv[]) /* Parse config file, fail if cannot be done */ ret = load_configuration(tmp_ctx, config_file, &monitor); if (ret != EOK) { + /* if debug level has not been set, set it manually to make these + * critical failures visible */ + if (debug_level == SSSDBG_UNRESOLVED) { + debug_level = SSSDBG_MASK_ALL; + } + if (ret == EPERM) { DEBUG(1, ("Cannot read configuration file %s\n", config_file)); sss_log(SSS_LOG_ALERT, -- cgit