summaryrefslogtreecommitdiff
path: root/lib/util
diff options
context:
space:
mode:
authorRalph Wuerthner <ralph.wuerthner@de.ibm.com>2019-03-25 15:17:07 +0100
committerKarolin Seeger <kseeger@samba.org>2019-05-17 07:18:28 +0000
commit9348090b5e248d469c974df57d42f0cf71988cc8 (patch)
tree7ac0311dec26de4664db05f6d2746c2a25720bc2 /lib/util
parentadc1277e3923496e7fa87a24204007bae1ad3dbb (diff)
downloadsamba-9348090b5e248d469c974df57d42f0cf71988cc8.tar.gz
s3:debug: enable logging for early startup failures
Commit c89a33a07a 'debug: Use backends instead of explicitly logging to syslog or file' introduced a regression where early startup failures (e.g. unable to connect to CTDB) are no longer logged because the debug subsystem is not yet fully initialized. Enable logging again with reasonable defaults when reopen_logs() is called and the parameter file is not yet parsed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13904 Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Thu Apr 18 22:21:15 UTC 2019 on sn-devel-144 (cherry picked from commit 9b30fcda64080592d20de64b384fd6d3d0775cbf)
Diffstat (limited to 'lib/util')
-rw-r--r--lib/util/debug_s3.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/util/debug_s3.c b/lib/util/debug_s3.c
index 381b9d49102..5384ac1718a 100644
--- a/lib/util/debug_s3.c
+++ b/lib/util/debug_s3.c
@@ -47,6 +47,25 @@ bool reopen_logs(void)
lp_logging(talloc_tos()),
lp_syslog(),
lp_syslog_only());
+ } else {
+ /*
+ * Parameters are not yet loaded - configure debugging with
+ * reasonable defaults to enable logging for early
+ * startup failures.
+ */
+ struct debug_settings settings = {
+ .max_log_size = 5000,
+ .timestamp_logs = true,
+ .debug_prefix_timestamp = false,
+ .debug_hires_timestamp = true,
+ .debug_pid = false,
+ .debug_uid = false,
+ .debug_class = false,
+ };
+ debug_set_settings(&settings,
+ "file",
+ 1,
+ false);
}
return reopen_logs_internal();
}