The Samba-Bugzilla – Bug 6595
Max logfile size parameter
Last modified: 2018-07-03 15:19:25 UTC
It seems valuable to have a possibility to set the maximum size of the ctdb log file (e.g. inherit from the Samba's "max log size" directive or set via environment variable in /etc/sysconfig/ctdb).
In case of debuggigng a problem the logfiles can grow quickly to undesirable sizes yet it is sometimes necessary to wait until the problem debugged reproduces.
Thanks for filing this bug report!
It is not only the log size.
but we first need infrastructure for reopening the logs at all.
An alternative to "max log size" which makes sense for samba with all
its possibbly very many log files would be to simply react with some
"reopen_logs" to a HUP signal and rely on an external logrotate mechanism
to trigger the actual rotation.
I just talked to ronnie today about this problem.
We need some solution like this!
Meanwhile, you can make ctdb log to syslog by running ctdbd with "--syslog".
This has automatic log rotation..
I just committed a patch to make this configurable via the sysconfig/ctdb file
with the new variable CTDB_SYSLOG=[yes/no] which defaults to "no".
This will be in 1.0.91 if I am not mistaken.
Cheers - Michael
I'm going to steal this bug to track the lack of log rotation in CTDB.
It can be worked around in all currently supported versions by using
CTDB_LOGGING=syslog (or a variant) to log to syslog, which supports
CTDB's logging currently uses the Samba debug module, but uses the
callback mechanism instead of any of the built-in ones.
Notes about the different types of logging supported by CTDB:
Direct to file with no re-open mechanism, which is required for
Has obvious implementation using syslog(3).
Additional support for non-blocking/lossy logging via either
non-blocking logging to /dev/log or UDP.
So, instead of supporting log rotation directly in CTDB, the approach
here would be to switch to using Samba's debug.[ch] file logging
directly. Then we get the rotation for free and we have even less
Blocking this is CTDB's use of debug_extra, where the string value of
that variable is prefixed to every log message. I think that we should
be able to replace this by using logging classes... but this is quite a
bit of work so would need a chunk of time.
If we fix the debug_extra issue then we could also port any desired
non-blocking support into debug.[ch] and drop the CTDB logging
entirely. However, this would be a secondary effort.
Moving this to CTDB component of Samba.