how to limit log file size in Samba4

I am running Samba4 4.1.11 on Slackware64 14.1. I have the following in my /etc/samba/smb.conf

   log level = 3 passdb:5 auth:10 winbind:2
   max log size = 5000

However, my samba log files are:
$ ls -lh /var/log/samba
total 137M
drwx------ 3 root root 4.0K 2015-02-24 20:29 cores/
-rw-r--r-- 1 root root 129M 2015-03-13 02:37 log.samba
-rw-r--r-- 1 root root 3.0M 2015-03-13 02:39 log.smbd
-rw-r--r-- 1 root root 4.9M 2015-03-13 01:49 log.smbd.old

Open in new window

It does seem to be limiting the log.smbd file to 5M, but the log.samba file just keeps growing. Is there another option for this log file? If so, I haven't come across it yet. I can do this in logrotate, but I'd rather use a samba directive so I don't have to restart samba.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Phil PhillipsDevOps ArchitectCommented:
I'm not too familiar with the internals of Samba log rotation, but you should be able to use logrotate without having a restart samba.  You can set it up so that logrotate sends Samba a SIGHUP (Samba "reloads" after a SIGHUP - this should also re-open file descriptors for log files).

You'll have to set "max log size" to 0 in this case though.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MarkAuthor Commented:
Hmmm, I was hoping there was some additional samba config directive. Seems strange that the 'max log size' would apply to one logfile and not the other. I'll research a bit more before resorting to logrotate, although the SIGHUP idea is a good one.
You'll have to set "max log size" to 0 in this case though.
Actually, I don't think I'll have to do that as the log.smbd file seems to be the only one affected by the 'max log size' directive and that's taking care of itself just fine.
Phil PhillipsDevOps ArchitectCommented:
Yes, the ideal solution is a directive that'll apply to all files, so you don't have mismatched ways of rotating.  If I come across anything, I'll let you know.
MarkAuthor Commented:
No samba-internal solutions appears to exists (that I can find) and the logrotate solutions seems to be working fine. Maybe the next release of Samba will include log.samba in its 'max log size' directivesm not just log.smbd
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.