Bug 6595 - Max logfile size parameter
Max logfile size parameter
Product: Samba 4.1 and newer
Classification: Unclassified
Component: CTDB
All All
: P3 enhancement
: ---
Assigned To: Martin Schwenke
Michael Adam
Depends on:
  Show dependency treegraph
Reported: 2009-07-31 14:48 UTC by Michal Strnad
Modified: 2016-09-07 00:03 UTC (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Michal Strnad 2009-07-31 14:48:15 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.
Comment 1 Michael Adam 2009-09-15 06:36:29 UTC
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
Comment 2 Martin Schwenke 2016-09-07 00:01:53 UTC
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
log rotation.

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:

* file

  Direct to file with no re-open mechanism, which is required for

* syslog

  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
duplicated code.

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.
Comment 3 Martin Schwenke 2016-09-07 00:03:19 UTC
Moving this to CTDB component of Samba.