samba4 log rotation

Scott Lovenberg scott.lovenberg at gmail.com
Mon Jul 8 11:10:16 MDT 2013


On Mon, Jul 8, 2013 at 11:18 AM, David Mansfield <samba at dm.cobite.com> wrote:
> H All:
>
> I have read through archives of this mailing list (from about a year ago)
> and was wondering if there have been any changes since then w.r.t samba log
> rotation.
>
> It seems like "max log size" still only applies to smbd process (or more
> specifically log.smbd) and not to samba process (or more specifically
> log.samba).
>
> Furthermore, after renaming the log.samba to log.samba.old then "killall
> -HUP samba"  and "killall -HUP smbd", both samba and smbd processes (and
> children) still have log.samba.old open according to lsof.
>
> This is with a fairly out-of-the-box configuration from source 4.0.5 running
> on centos 6. (configured with default paths i.e. /usr/local/samba etc.).
>
> Is there any way short of restarting samba process to rotate the log.samba
> log?
>
> Thanks,
> David Mansfield
>

I just use the following logrotate(8) config file:
[root at pdc2 ~]# cat /etc/logrotate.d/samba
/usr/local/samba/var/log.samba
/usr/local/samba/var/log.smbd
/usr/local/samba/var/log.winbindd
/usr/local/samba/var/log.swat
{
        daily
        compress
        rotate 90
        missingok
        copytruncate
}


This seems to work fine for me, but I haven't tested it extensively.
Also, you can remove the swat line; you very probably don't have it
installed.

--
Peace and Blessings,
-Scott.


More information about the samba-technical mailing list