From bbfc736f268af22d059a22dc85ed3c4345df4cb1 Mon Sep 17 00:00:00 2001 From: Jones Syue Date: Mon, 2 Sep 2024 17:11:00 +0800 Subject: [PATCH] s3: SIGHUP handlers use consistent log level 3 When turn-on 'log level = 3', sending SIGHUP to samba processes, for example: smbd parent/children, smbd-notifyd, and smbd-cleanupd. Then monitor log.smbd in order to parse sighup logs, it looks like the log level is inconsistent among these processes: smbd parent/children use level 1, and smbd-notifyd/smbd-cleanupd use level 3. This patch raises sighup handler's log level from level 1 to level 3, which is more consistent with smbd-notifyd by Commit 6e5bff80a0a0b ("s3:notifyd: Handle sigup in notifyd to reparse smb.conf"), and smbd-cleanupd by Commit 57c1e115ecef4 ("smbd: reopen logs on SIGHUP for notifyd and cleanupd"). BUG: https://bugzilla.samba.org/show_bug.cgi?id=15706 Signed-off-by: Jones Syue Reviewed-by: Jeremy Allison Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Sep 25 01:38:02 UTC 2024 on atb-devel-224 (cherry picked from commit 4f3dfb2029c667b6dcd43223fe154dca59143e95) Autobuild-User(v4-21-test): Jule Anger Autobuild-Date(v4-21-test): Fri Oct 4 10:13:17 UTC 2024 on atb-devel-224 --- source3/printing/queue_process.c | 2 +- source3/smbd/server.c | 2 +- source3/smbd/smb2_process.c | 2 +- source3/winbindd/winbindd_dual.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source3/printing/queue_process.c b/source3/printing/queue_process.c index d1e95bb083a..0f95bd736f2 100644 --- a/source3/printing/queue_process.c +++ b/source3/printing/queue_process.c @@ -221,7 +221,7 @@ static void bq_sig_hup_handler(struct tevent_context *ev, state = talloc_get_type_abort(pvt, struct bq_state); change_to_root_user(); - DEBUG(1, ("Reloading pcap cache after SIGHUP\n")); + DBG_NOTICE("Reloading pcap cache after SIGHUP\n"); pcap_cache_reload(state->ev, state->msg, reload_pcap_change_notify); printing_subsystem_queue_tasks(state); diff --git a/source3/smbd/server.c b/source3/smbd/server.c index e9ba7be9166..71deecb3d96 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -1426,7 +1426,7 @@ static void smbd_parent_sig_hup_handler(struct tevent_context *ev, void *private_data) { change_to_root_user(); - DEBUG(1,("parent: Reloading services after SIGHUP\n")); + DBG_NOTICE("parent: Reloading services after SIGHUP\n"); reload_services(NULL, NULL, false); } diff --git a/source3/smbd/smb2_process.c b/source3/smbd/smb2_process.c index a4a0e8265ad..6931bfba81c 100644 --- a/source3/smbd/smb2_process.c +++ b/source3/smbd/smb2_process.c @@ -1677,7 +1677,7 @@ static void smbd_sig_hup_handler(struct tevent_context *ev, struct smbd_server_connection); change_to_root_user(); - DEBUG(1,("Reloading services after SIGHUP\n")); + DBG_NOTICE("Reloading services after SIGHUP\n"); reload_services(sconn, conn_snum_used, false); } diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c index fdb66d0e1c7..d4e1995f928 100644 --- a/source3/winbindd/winbindd_dual.c +++ b/source3/winbindd/winbindd_dual.c @@ -2062,7 +2062,7 @@ static void winbindd_sig_hup_handler(struct tevent_context *ev, { const char *file = (const char *)private_data; - DEBUG(1,("Reloading services after SIGHUP\n")); + DBG_NOTICE("Reloading services after SIGHUP\n"); flush_caches_noinit(); winbindd_reload_services_file(file); }