The Samba-Bugzilla – Attachment 16362 Details for
Bug 14248
samba process does not honor max log size
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for 4.12 backported from master
bug14248-v412.patch (text/plain), 23.13 KB, created by
Ralph Böhme
on 2020-12-08 15:08:31 UTC
(
hide
)
Description:
Patch for 4.12 backported from master
Filename:
MIME Type:
Creator:
Ralph Böhme
Created:
2020-12-08 15:08:31 UTC
Size:
23.13 KB
patch
obsolete
>From 0c23744338a7b674d4f10f0083e4817255497a3a Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Fri, 13 Nov 2020 12:34:50 +0100 >Subject: [PATCH 01/11] loadparm: setup debug subsystem setting max_log_size > from config > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14248 > >Signed-off-by: Ralph Boehme <slow@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit ab2c712c016f4e4dacd5064b9eb8f6417f4b9b60) >--- > lib/param/loadparm.c | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c >index 63291283905..8bca0ee632a 100644 >--- a/lib/param/loadparm.c >+++ b/lib/param/loadparm.c >@@ -3159,6 +3159,7 @@ static bool lpcfg_update(struct loadparm_context *lp_ctx) > settings.debug_pid = lp_ctx->globals->debug_pid; > settings.debug_uid = lp_ctx->globals->debug_uid; > settings.debug_class = lp_ctx->globals->debug_class; >+ settings.max_log_size = lp_ctx->globals->max_log_size; > debug_set_settings(&settings, lp_ctx->globals->logging, > lp_ctx->globals->syslog, > lp_ctx->globals->syslog_only); >-- >2.26.2 > > >From d560450d94d7496969801d2386a9e5daab7f0b57 Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Mon, 23 Nov 2020 15:46:47 +0100 >Subject: [PATCH 02/11] debug: pass struct debug_class *config to > reopen_one_log() > >Pass a pointer to the struct instead of all struct members individually. No >change in behaviour. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14248 > >Signed-off-by: Ralph Boehme <slow@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit 29cd139a32d5dbf36bef68eb9c7f1160201e3042) >--- > lib/util/debug.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > >diff --git a/lib/util/debug.c b/lib/util/debug.c >index 1650551a766..681b12e0046 100644 >--- a/lib/util/debug.c >+++ b/lib/util/debug.c >@@ -1082,14 +1082,15 @@ static void debug_callback_log(const char *msg, int msg_level) > Fix from dgibson@linuxcare.com. > **************************************************************************/ > >-static bool reopen_one_log(int *fd, const char *logfile) >+static bool reopen_one_log(struct debug_class *config) > { >- int old_fd = *fd; >+ int old_fd = config->fd; >+ const char *logfile = config->logfile; > int new_fd; > > if (logfile == NULL) { > debug_close_fd(old_fd); >- *fd = -1; >+ config->fd = -1; > return true; > } > >@@ -1104,7 +1105,7 @@ static bool reopen_one_log(int *fd, const char *logfile) > > debug_close_fd(old_fd); > smb_set_close_on_exec(new_fd); >- *fd = new_fd; >+ config->fd = new_fd; > > return true; > } >@@ -1164,8 +1165,7 @@ bool reopen_logs_internal(void) > state.reopening_logs = true; > > for (i = DBGC_ALL; i < debug_num_classes; i++) { >- ok = reopen_one_log(&dbgc_config[i].fd, >- dbgc_config[i].logfile); >+ ok = reopen_one_log(&dbgc_config[i]); > if (!ok) { > break; > } >-- >2.26.2 > > >From 074b24baa060a682c9c97c1faeec8a7ca821b8d8 Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Mon, 23 Nov 2020 15:51:09 +0100 >Subject: [PATCH 03/11] debug: pass struct debug_class *config to > do_one_check_log_size() > >Pass a pointer to the struct instead of all struct members individually. No >change in behaviour. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14248 > >Signed-off-by: Ralph Boehme <slow@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit b7ee36146458bcc2c944f5670b7632df8281ae61) >--- > lib/util/debug.c | 22 +++++++++------------- > 1 file changed, 9 insertions(+), 13 deletions(-) > >diff --git a/lib/util/debug.c b/lib/util/debug.c >index 681b12e0046..6764578096a 100644 >--- a/lib/util/debug.c >+++ b/lib/util/debug.c >@@ -1249,11 +1249,10 @@ bool need_to_check_log_size(void) > Check to see if the log has grown to be too big. > **************************************************************************/ > >-static void do_one_check_log_size(off_t maxlog, int *_fd, const char *logfile) >+static void do_one_check_log_size(off_t maxlog, struct debug_class *config) > { >- char name[strlen(logfile) + 5]; >+ char name[strlen(config->logfile) + 5]; > struct stat st; >- int fd = *_fd; > int ret; > bool ok; > >@@ -1261,7 +1260,7 @@ static void do_one_check_log_size(off_t maxlog, int *_fd, const char *logfile) > return; > } > >- ret = fstat(fd, &st); >+ ret = fstat(config->fd, &st); > if (ret != 0) { > return; > } >@@ -1271,12 +1270,11 @@ static void do_one_check_log_size(off_t maxlog, int *_fd, const char *logfile) > > /* reopen_logs_internal() modifies *_fd */ > (void)reopen_logs_internal(); >- fd = *_fd; > >- if (fd <= 2) { >+ if (config->fd <= 2) { > return; > } >- ret = fstat(fd, &st); >+ ret = fstat(config->fd, &st); > if (ret != 0) { > return; > } >@@ -1284,16 +1282,16 @@ static void do_one_check_log_size(off_t maxlog, int *_fd, const char *logfile) > return; > } > >- snprintf(name, sizeof(name), "%s.old", logfile); >+ snprintf(name, sizeof(name), "%s.old", config->logfile); > >- (void)rename(logfile, name); >+ (void)rename(config->logfile, name); > > ok = reopen_logs_internal(); > if (ok) { > return; > } > /* We failed to reopen a log - continue using the old name. */ >- (void)rename(name, logfile); >+ (void)rename(name, config->logfile); > } > > static void do_check_log_size(off_t maxlog) >@@ -1307,9 +1305,7 @@ static void do_check_log_size(off_t maxlog) > if (dbgc_config[i].logfile == NULL) { > continue; > } >- do_one_check_log_size(maxlog, >- &dbgc_config[i].fd, >- dbgc_config[i].logfile); >+ do_one_check_log_size(maxlog, &dbgc_config[i]); > } > } > >-- >2.26.2 > > >From f3b869692d87674e55ec6c0e5122d06875a97d4e Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Mon, 23 Nov 2020 16:04:03 +0100 >Subject: [PATCH 04/11] debug: detect logrotation by checking inode number > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14248 > >Signed-off-by: Ralph Boehme <slow@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit 3651a51e93b45104323d5db1d5ea704d4f71acf1) >--- > lib/util/debug.c | 31 +++++++++++++++++++++++++++++-- > 1 file changed, 29 insertions(+), 2 deletions(-) > >diff --git a/lib/util/debug.c b/lib/util/debug.c >index 6764578096a..692e97e3390 100644 >--- a/lib/util/debug.c >+++ b/lib/util/debug.c >@@ -113,6 +113,8 @@ struct debug_class { > */ > char *logfile; > int fd; >+ /* inode number of the logfile to detect logfile rotation */ >+ ino_t ino; > }; > > static const char *default_classname_table[] = { >@@ -1086,7 +1088,9 @@ static bool reopen_one_log(struct debug_class *config) > { > int old_fd = config->fd; > const char *logfile = config->logfile; >+ struct stat st; > int new_fd; >+ int ret; > > if (logfile == NULL) { > debug_close_fd(old_fd); >@@ -1107,6 +1111,16 @@ static bool reopen_one_log(struct debug_class *config) > smb_set_close_on_exec(new_fd); > config->fd = new_fd; > >+ ret = fstat(new_fd, &st); >+ if (ret != 0) { >+ log_overflow = true; >+ DBG_ERR("Unable to fstat() new log file '%s': %s\n", >+ logfile, strerror(errno)); >+ log_overflow = false; >+ return false; >+ } >+ >+ config->ino = st.st_ino; > return true; > } > >@@ -1254,17 +1268,26 @@ static void do_one_check_log_size(off_t maxlog, struct debug_class *config) > char name[strlen(config->logfile) + 5]; > struct stat st; > int ret; >+ bool reopen = false; > bool ok; > > if (maxlog == 0) { > return; > } > >- ret = fstat(config->fd, &st); >+ ret = stat(config->logfile, &st); > if (ret != 0) { > return; > } >- if (st.st_size < maxlog ) { >+ if (st.st_size >= maxlog ) { >+ reopen = true; >+ } >+ >+ if (st.st_ino != config->ino) { >+ reopen = true; >+ } >+ >+ if (!reopen) { > return; > } > >@@ -1276,8 +1299,12 @@ static void do_one_check_log_size(off_t maxlog, struct debug_class *config) > } > ret = fstat(config->fd, &st); > if (ret != 0) { >+ config->ino = (ino_t)0; > return; > } >+ >+ config->ino = st.st_ino; >+ > if (st.st_size < maxlog) { > return; > } >-- >2.26.2 > > >From d5521ccd5fbad7d89b2a7146e515f42c117ea724 Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Mon, 23 Nov 2020 17:53:57 +0100 >Subject: [PATCH 05/11] s4: add samba server tevent trace helper stuff > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14248 > >Signed-off-by: Ralph Boehme <slow@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(backported from commit 68f71f227b17774a12c84575c1eecd82279fac95) >[slow@samba.org: conflict due to rename source4/smbd/ -> source4/samba/ in master] >--- > source4/smbd/server_util.c | 94 ++++++++++++++++++++++++++++++++++++++ > source4/smbd/server_util.h | 33 +++++++++++++ > source4/smbd/wscript_build | 4 ++ > 3 files changed, 131 insertions(+) > create mode 100644 source4/smbd/server_util.c > create mode 100644 source4/smbd/server_util.h > >diff --git a/source4/smbd/server_util.c b/source4/smbd/server_util.c >new file mode 100644 >index 00000000000..282ad9b17cd >--- /dev/null >+++ b/source4/smbd/server_util.c >@@ -0,0 +1,94 @@ >+/* >+ Unix SMB/CIFS implementation. >+ >+ Utility routines >+ >+ Copyright (C) 2020 Ralph Boehme <slow@samba.org> >+ >+ This program is free software; you can redistribute it and/or modify >+ it under the terms of the GNU General Public License as published by >+ the Free Software Foundation; either version 3 of the License, or >+ (at your option) any later version. >+ >+ This program is distributed in the hope that it will be useful, >+ but WITHOUT ANY WARRANTY; without even the implied warranty of >+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+ GNU General Public License for more details. >+ >+ You should have received a copy of the GNU General Public License >+ along with this program. If not, see <http://www.gnu.org/licenses/>. >+*/ >+ >+#include "includes.h" >+#include "lib/tevent/tevent.h" >+#include "lib/util/unix_privs.h" >+#include "server_util.h" >+ >+struct samba_tevent_trace_state { >+ size_t events; >+ time_t last_logsize_check; >+}; >+ >+struct samba_tevent_trace_state *create_samba_tevent_trace_state( >+ TALLOC_CTX *mem_ctx) >+{ >+ return talloc_zero(mem_ctx, struct samba_tevent_trace_state); >+} >+ >+void samba_tevent_trace_callback(enum tevent_trace_point point, >+ void *private_data) >+{ >+ struct samba_tevent_trace_state *state = >+ talloc_get_type_abort(private_data, >+ struct samba_tevent_trace_state); >+ time_t now = time(NULL); >+ bool do_check_logs = false; >+ void *priv = NULL; >+ >+ switch (point) { >+ case TEVENT_TRACE_BEFORE_WAIT: >+ break; >+ default: >+ return; >+ } >+ >+ state->events++; >+ >+ /* >+ * Throttling by some random numbers. smbd uses a similar logic >+ * checking every 50 SMB requests. Assuming 4 events per request >+ * we get to the number of 200. >+ */ >+ if ((state->events % 200) == 0) { >+ do_check_logs = true; >+ } >+ /* >+ * Throttling by some delay, choosing 29 to avoid lockstep with >+ * the default tevent tickle timer. >+ */ >+ if ((state->last_logsize_check + 29) < now) { >+ do_check_logs = true; >+ } >+ >+ if (!do_check_logs) { >+ return; >+ } >+ >+ /* >+ * need_to_check_log_size() checks both the number of messages >+ * that have been logged and if the logging backend is actually >+ * going to file. We want to bypass the "number of messages" >+ * check, so we have to call force_check_log_size() before. >+ */ >+ force_check_log_size(); >+ if (!need_to_check_log_size()) { >+ return; >+ } >+ >+ priv = root_privileges(); >+ check_log_size(); >+ TALLOC_FREE(priv); >+ >+ state->last_logsize_check = now; >+ return; >+} >diff --git a/source4/smbd/server_util.h b/source4/smbd/server_util.h >new file mode 100644 >index 00000000000..08c09cc67c2 >--- /dev/null >+++ b/source4/smbd/server_util.h >@@ -0,0 +1,33 @@ >+/* >+ Unix SMB/CIFS implementation. >+ >+ Utility routines >+ >+ Copyright (C) 2020 Ralph Boehme <slow@samba.org> >+ >+ This program is free software; you can redistribute it and/or modify >+ it under the terms of the GNU General Public License as published by >+ the Free Software Foundation; either version 3 of the License, or >+ (at your option) any later version. >+ >+ This program is distributed in the hope that it will be useful, >+ but WITHOUT ANY WARRANTY; without even the implied warranty of >+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+ GNU General Public License for more details. >+ >+ You should have received a copy of the GNU General Public License >+ along with this program. If not, see <http://www.gnu.org/licenses/>. >+*/ >+ >+#ifndef SAMBA_SERVER_UTIL_H >+#define SAMBA_SERVER_UTIL_H >+ >+struct samba_tevent_trace_state; >+ >+struct samba_tevent_trace_state *create_samba_tevent_trace_state( >+ TALLOC_CTX *mem_ctx); >+ >+void samba_tevent_trace_callback(enum tevent_trace_point point, >+ void *private_data); >+ >+#endif >diff --git a/source4/smbd/wscript_build b/source4/smbd/wscript_build >index ef0aaf773c1..146098ec8e4 100644 >--- a/source4/smbd/wscript_build >+++ b/source4/smbd/wscript_build >@@ -17,6 +17,10 @@ bld.SAMBA_LIBRARY('process_model', > enabled=bld.AD_DC_BUILD_IS_ENABLED() > ) > >+bld.SAMBA_SUBSYSTEM('samba_server_util', >+ source='server_util.c', >+ deps='samba-util') >+ > bld.SAMBA_BINARY('samba', > source='server.c', > subsystem_name='service', >-- >2.26.2 > > >From 7f64c45c0bc409b11e12e3f2e9a61188a6b36d95 Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Thu, 26 Nov 2020 14:21:58 +0100 >Subject: [PATCH 06/11] s4: install tevent tracing hooks to trigger logfile > rotation > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14248 > >Signed-off-by: Ralph Boehme <slow@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(backported from commit 516c2a04a242a539f9fbddb2822295fee233644c) >[slow@samba.org: process_prefork.c has additional include in master] >--- > source4/smbd/process_prefork.c | 13 +++++++++++++ > source4/smbd/server.c | 17 +++++++++++++++++ > source4/smbd/wscript_build | 5 +++-- > 3 files changed, 33 insertions(+), 2 deletions(-) > >diff --git a/source4/smbd/process_prefork.c b/source4/smbd/process_prefork.c >index 5667fb5f1ef..950db6a1c7d 100644 >--- a/source4/smbd/process_prefork.c >+++ b/source4/smbd/process_prefork.c >@@ -44,6 +44,7 @@ > #include "ldb_wrap.h" > #include "lib/util/tfork.h" > #include "lib/messaging/irpc.h" >+#include "server_util.h" > > #define min(a, b) (((a) < (b)) ? (a) : (b)) > >@@ -243,6 +244,7 @@ static void prefork_fork_master( > struct tevent_context *ev2; > struct task_server *task = NULL; > struct process_details pd = initial_process_details; >+ struct samba_tevent_trace_state *samba_tevent_trace_state = NULL; > int control_pipe[2]; > > t = tfork_create(); >@@ -321,6 +323,17 @@ static void prefork_fork_master( > */ > ev2 = s4_event_context_init(NULL); > >+ samba_tevent_trace_state = create_samba_tevent_trace_state(ev2); >+ if (samba_tevent_trace_state == NULL) { >+ TALLOC_FREE(ev); >+ TALLOC_FREE(ev2); >+ exit(127); >+ } >+ >+ tevent_set_trace_callback(ev2, >+ samba_tevent_trace_callback, >+ samba_tevent_trace_state); >+ > /* setup this new connection: process will bind to it's sockets etc > * > * While we can use ev for the child, which has been re-initialised >diff --git a/source4/smbd/server.c b/source4/smbd/server.c >index 95acb99b86c..c92988352f2 100644 >--- a/source4/smbd/server.c >+++ b/source4/smbd/server.c >@@ -46,6 +46,7 @@ > #include "lib/util/tfork.h" > #include "dsdb/samdb/ldb_modules/util.h" > #include "lib/util/server_id.h" >+#include "server_util.h" > > #ifdef HAVE_PTHREAD > #include <pthread.h> >@@ -572,6 +573,7 @@ static int binary_smbd_main(const char *binary_name, > }; > struct server_state *state = NULL; > struct tevent_signal *se = NULL; >+ struct samba_tevent_trace_state *samba_tevent_trace_state = NULL; > > setproctitle("root process"); > >@@ -727,6 +729,21 @@ static int binary_smbd_main(const char *binary_name, > > talloc_set_destructor(state->event_ctx, event_ctx_destructor); > >+ samba_tevent_trace_state = create_samba_tevent_trace_state(state); >+ if (samba_tevent_trace_state == NULL) { >+ exit_daemon("Samba failed to setup tevent tracing state", >+ ENOTTY); >+ /* >+ * return is never reached but is here to satisfy static >+ * checkers >+ */ >+ return 1; >+ } >+ >+ tevent_set_trace_callback(state->event_ctx, >+ samba_tevent_trace_callback, >+ samba_tevent_trace_state); >+ > if (opt_interactive) { > /* terminate when stdin goes away */ > stdin_event_flags = TEVENT_FD_READ; >diff --git a/source4/smbd/wscript_build b/source4/smbd/wscript_build >index 146098ec8e4..14267c1c9a5 100644 >--- a/source4/smbd/wscript_build >+++ b/source4/smbd/wscript_build >@@ -25,7 +25,8 @@ bld.SAMBA_BINARY('samba', > source='server.c', > subsystem_name='service', > deps='''events process_model service samba-hostconfig samba-util POPT_SAMBA >- popt gensec registry ntvfs share cluster COMMON_SCHANNEL SECRETS''', >+ popt gensec registry ntvfs share cluster COMMON_SCHANNEL SECRETS >+ samba_server_util''', > pyembed=True, > install_path='${SBINDIR}', > enabled=bld.AD_DC_BUILD_IS_ENABLED() >@@ -52,6 +53,6 @@ bld.SAMBA_MODULE('process_model_prefork', > source='process_prefork.c', > subsystem='process_model', > init_function='process_model_prefork_init', >- deps='MESSAGING events ldbsamba cluster samba-sockets process_model messages_dgm', >+ deps='MESSAGING events ldbsamba cluster samba-sockets process_model messages_dgm samba_server_util', > internal_module=False > ) >-- >2.26.2 > > >From ea37adb5a1ab26372d50b52a4a38b4d913ea5a7d Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Fri, 20 Nov 2020 15:21:03 +0100 >Subject: [PATCH 07/11] s4: replace low-level SIGUP handler with a tevent > handler > >Replace the low-level signal handler for SIGHUP with a nice tevent signal >handler. The low-level handler sig_hup() installed by setup_signals() remains >being used during early startup before a tevent context is available. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14248 > >Signed-off-by: Ralph Boehme <slow@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit 9f71e6173ab43a04804ba8061cb0e8ae6c0165bf) >--- > source4/smbd/server.c | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > >diff --git a/source4/smbd/server.c b/source4/smbd/server.c >index c92988352f2..9068bfcaeb8 100644 >--- a/source4/smbd/server.c >+++ b/source4/smbd/server.c >@@ -155,6 +155,19 @@ static void sigterm_signal_handler(struct tevent_context *ev, > sig_term(SIGTERM); > } > >+static void sighup_signal_handler(struct tevent_context *ev, >+ struct tevent_signal *se, >+ int signum, int count, void *siginfo, >+ void *private_data) >+{ >+ struct server_state *state = talloc_get_type_abort( >+ private_data, struct server_state); >+ >+ DBG_DEBUG("Process %s got SIGHUP\n", state->binary_name); >+ >+ reopen_logs_internal(); >+} >+ > /* > setup signal masks > */ >@@ -832,6 +845,22 @@ static int binary_smbd_main(const char *binary_name, > return 1; > } > >+ se = tevent_add_signal(state->event_ctx, >+ state->event_ctx, >+ SIGHUP, >+ 0, >+ sighup_signal_handler, >+ state); >+ if (se == NULL) { >+ TALLOC_FREE(state); >+ exit_daemon("Initialize SIGHUP handler failed", ENOMEM); >+ /* >+ * return is never reached but is here to satisfy static >+ * checkers >+ */ >+ return 1; >+ } >+ > if (lpcfg_server_role(cmdline_lp_ctx) != ROLE_ACTIVE_DIRECTORY_DC > && !lpcfg_parm_bool(cmdline_lp_ctx, NULL, > "server role check", "inhibit", false) >-- >2.26.2 > > >From b2ead79e2e2afe0d45ebab38e4a132fef4258152 Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Mon, 23 Nov 2020 16:44:04 +0100 >Subject: [PATCH 08/11] s4: call reopen_logs_internal() in the SIGHUP handler > of the prefork process model > >With debug_schedule_reopen_logs() the actual reopen only takes place at some >point in the future when a DEBUG message is processed. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14248 > >Signed-off-by: Ralph Boehme <slow@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit 19413e76a46f07fdd46fde5e60707bb6845a782d) >--- > source4/smbd/process_prefork.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/source4/smbd/process_prefork.c b/source4/smbd/process_prefork.c >index 950db6a1c7d..73b4d3a11d9 100644 >--- a/source4/smbd/process_prefork.c >+++ b/source4/smbd/process_prefork.c >@@ -114,7 +114,7 @@ static void sighup_signal_handler(struct tevent_context *ev, > int signum, int count, void *siginfo, > void *private_data) > { >- debug_schedule_reopen_logs(); >+ reopen_logs_internal(); > } > > static void sigterm_signal_handler(struct tevent_context *ev, >-- >2.26.2 > > >From d384221e84fabfd171c5ab0800b0f33b05a0c6cf Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Thu, 26 Nov 2020 15:23:58 +0100 >Subject: [PATCH 09/11] s4/samba: call force_check_log_size() in > prefork_reload_after_fork() > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14248 > >Signed-off-by: Ralph Boehme <slow@samba.org> >(cherry picked from commit 82b64e930b0e2d3b2e5186017d9f8e420994136c) >--- > source4/smbd/process_prefork.c | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/source4/smbd/process_prefork.c b/source4/smbd/process_prefork.c >index 73b4d3a11d9..ec0ebc24029 100644 >--- a/source4/smbd/process_prefork.c >+++ b/source4/smbd/process_prefork.c >@@ -154,6 +154,7 @@ static void prefork_reload_after_fork(void) > if (!NT_STATUS_IS_OK(status)) { > smb_panic("Failed to re-initialise imessaging after fork"); > } >+ force_check_log_size(); > } > > /* >-- >2.26.2 > > >From c39af81e7d194c05bc6a4eb0e49cd586c3d5d45d Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Thu, 26 Nov 2020 15:24:26 +0100 >Subject: [PATCH 10/11] s4/samba: call force_check_log_size() in > standard_accept_connection() > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14248 > >Signed-off-by: Ralph Boehme <slow@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit 6fa5fb8ef26dab862df5c46bb5e74f19839c30e2) >--- > source4/smbd/process_standard.c | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/source4/smbd/process_standard.c b/source4/smbd/process_standard.c >index 139339c92ec..878c4f1209c 100644 >--- a/source4/smbd/process_standard.c >+++ b/source4/smbd/process_standard.c >@@ -401,6 +401,8 @@ static void standard_accept_connection( > talloc_free(c); > talloc_free(s); > >+ force_check_log_size(); >+ > /* setup this new connection. Cluster ID is PID based for this process model */ > new_conn(ev, lp_ctx, sock2, cluster_id(pid, 0), private_data, > process_context); >-- >2.26.2 > > >From f210c225ba231229936adbbd85b4f4b521803106 Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Thu, 26 Nov 2020 15:24:44 +0100 >Subject: [PATCH 11/11] s4/samba: call force_check_log_size() in > standard_new_task() > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14248 >RN: samba process does not honor max log size > >Signed-off-by: Ralph Boehme <slow@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> > >Autobuild-User(master): Jeremy Allison <jra@samba.org> >Autobuild-Date(master): Mon Dec 7 18:54:29 UTC 2020 on sn-devel-184 > >(cherry picked from commit 058f96f4c4eda42b404f0067521d3eafb495fe7d) >--- > source4/smbd/process_standard.c | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/source4/smbd/process_standard.c b/source4/smbd/process_standard.c >index 878c4f1209c..c5f6ec7f402 100644 >--- a/source4/smbd/process_standard.c >+++ b/source4/smbd/process_standard.c >@@ -504,6 +504,8 @@ static void standard_new_task(struct tevent_context *ev, > > setproctitle("task[%s]", service_name); > >+ force_check_log_size(); >+ > /* > * Set up the process context to be passed through to the terminate > * and accept_connection functions >-- >2.26.2 >
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:
jra
:
review+
Actions:
View
Attachments on
bug 14248
: 16362 |
16363