The Samba-Bugzilla – Attachment 18656 Details for
Bug 15869
Startup messages of rpc deamons fills /var/log/messages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for 4.22 and 4.21
0001-lib-util-Disable-logging-to-syslog-for-startup-messa.patch (text/plain), 2.76 KB, created by
Andreas Schneider
on 2025-06-23 15:13:54 UTC
(
hide
)
Description:
patch for 4.22 and 4.21
Filename:
MIME Type:
Creator:
Andreas Schneider
Created:
2025-06-23 15:13:54 UTC
Size:
2.76 KB
patch
obsolete
>From 0504a86f8e81420a66352aab14fbb77f327c4f33 Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Tue, 10 Jun 2025 13:46:13 +0200 >Subject: [PATCH] lib:util: Disable logging to syslog for startup messages > >D_ERR also is sent to syslog! > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=15869 > >Signed-off-by: Andreas Schneider <asn@samba.org> >Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> >Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> > >Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> >Autobuild-Date(master): Wed Jun 18 12:10:03 UTC 2025 on atb-devel-224 > >(cherry picked from commit 58c64ba25adb1c1d272ba196529b5465ae7ee9df) >--- > lib/util/debug.c | 15 +++++++++++++++ > lib/util/debug.h | 9 +++++++++ > 2 files changed, 24 insertions(+) > >diff --git a/lib/util/debug.c b/lib/util/debug.c >index 86f13f181cf..f79b8811a4b 100644 >--- a/lib/util/debug.c >+++ b/lib/util/debug.c >@@ -95,6 +95,7 @@ static struct { > bool reopening_logs; > bool schedule_reopen_logs; > int forced_log_priority; >+ bool disable_syslog; > > struct debug_settings settings; > debug_callback_fn callback; >@@ -302,6 +303,10 @@ static void debug_syslog_log(int msg_level, const char *msg, size_t msg_len) > { > int priority; > >+ if (state.disable_syslog) { >+ return; >+ } >+ > priority = debug_level_to_priority(msg_level); > > /* >@@ -1124,6 +1129,16 @@ void debug_set_forced_log_priority(int forced_log_priority) > state.forced_log_priority = forced_log_priority; > } > >+void debug_disable_syslog(void) >+{ >+ state.disable_syslog = true; >+} >+ >+void debug_enable_syslog(void) >+{ >+ state.disable_syslog = false; >+} >+ > /** > * Ensure debug logs are initialised. > * >diff --git a/lib/util/debug.h b/lib/util/debug.h >index f188105c9f4..2a56c7d48fe 100644 >--- a/lib/util/debug.h >+++ b/lib/util/debug.h >@@ -276,9 +276,16 @@ void debuglevel_set_class(size_t idx, int level); > #define DBGLVL_INFO 5 /* informational message */ > #define DBGLVL_DEBUG 10 /* debug-level message */ > >+/* >+ * Logging to syslog will be disabled as messages on debug level 0 are always >+ * reported to syslog too. We don't want to clutter the syslog with startup >+ * messages from rpc on demand daemons. >+ */ > #define DBG_STARTUP_NOTICE(...) do { \ > debug_set_forced_log_priority(DBGLVL_NOTICE); \ >+ debug_disable_syslog(); \ > D_ERR(__VA_ARGS__); \ >+ debug_enable_syslog(); \ > debug_set_forced_log_priority(-1); \ > } while(0) > >@@ -362,6 +369,8 @@ void debug_set_settings(struct debug_settings *settings, > int syslog_level, bool syslog_only); > void debug_set_hostname(const char *name); > void debug_set_forced_log_priority(int forced_log_priority); >+void debug_disable_syslog(void); >+void debug_enable_syslog(void); > bool reopen_logs_internal( void ); > void force_check_log_size( void ); > bool need_to_check_log_size( void ); >-- >2.50.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
dbagnall
:
review+
Actions:
View
Attachments on
bug 15869
: 18656