From 06ed4ccba6cfe08aef061866f98b1d1da26682b8 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Mon, 8 Nov 2021 12:09:43 +0100 Subject: [PATCH] lib/cmdline: setup default file logging for servers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BUG: https://bugzilla.samba.org/show_bug.cgi?id=14897 RN: samba process doesn't log to logfile Signed-off-by: Ralph Boehme Reviewed-by: Andreas Schneider Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Thu Nov 11 14:42:13 UTC 2021 on sn-devel-184 --- lib/cmdline/cmdline_s4.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/cmdline/cmdline_s4.c b/lib/cmdline/cmdline_s4.c index 6ef6f59db49..29e9f34bbe2 100644 --- a/lib/cmdline/cmdline_s4.c +++ b/lib/cmdline/cmdline_s4.c @@ -44,6 +44,20 @@ static bool _samba_cmdline_load_config_s4(void) } } + switch (_config_type) { + case SAMBA_CMDLINE_CONFIG_SERVER: { + const struct samba_cmdline_daemon_cfg *cmdline_daemon_cfg = + samba_cmdline_get_daemon_cfg(); + + if (!cmdline_daemon_cfg->interactive) { + setup_logging(getprogname(), DEBUG_FILE); + } + break; + } + default: + break; + } + config_file = get_dyn_CONFIGFILE(); ok = lpcfg_load(lp_ctx, config_file); if (!ok) {