[Samba] Log rotation issue

Anantha Raghava raghav at exzatechconsulting.com
Sat Dec 2 06:28:11 UTC 2017


Hello Andrew,

Thanks for proper explanation.

To overcome this,  also as we need to store logs for long,  now we have
written a shell script,  executed as a crop every three minutes that checks
the file size.  If the file size is 1 GB or above,  it moves the log file
to <logfile>.timestamp.log.old and clears the main log file.

We have commented out the max log size in sub.conf.

If need be I can share the script here

Best regards,
Anantha Raghava

On Dec 2, 2017 10:57 AM, "Andrew Bartlett" <abartlet at samba.org> wrote:

> On Fri, 2017-12-01 at 16:06 +0530, Anantha Raghava via samba wrote:
> > Hi,
> >
> > Continuing on the same subject, the VARIABLE SUBSTITUTIONS are not
> > working. for example, I want to have the date & time attached to the
> > samba log file. Hence I modified the smb.conf
> >
> > log file = /var/log/samba/samba.%T.log
> >
> > The file with name "samba.%T.log" gets created in /var/log/samba folder
> > and %T will not get substituted with current date & time.
>
> Yes, currently the 'samba' side of things (compared with smbd) doesn't
> know how to substitute the macros.  Now part of this is due to global
> variables and multiple clients per connection, but it doesn't really
> excuse us also skipping things like %T.
>
> > I request for your guidance to correct this part. Also the samba
> > continues to write into .old file as well and not finding any means to
> > correct it.
>
> I think this is because each process only checks if the file should be
> rotated every few lines, so they can hold the log open for quite some
> time.  Ideally a global signal would be sent saying which file (or even
> just that a file) just got rotated, so everyone can re-open.
>
> Patches are most welcome!
>
> Andrew Bartlett
> --
> Andrew Bartlett                       http://samba.org/~abartlet/
> Authentication Developer, Samba Team  http://samba.org
> Samba Developer, Catalyst IT          http://catalyst.net.nz/
> services/samba
>
>


More information about the samba mailing list