[Samba] Issues with log rotation

L.P.H. van Belle belle at bazuin.nl
Wed Sep 1 09:58:14 UTC 2021


Hai Viktor, 

well, stop searching , read : 
https://bugs.launchpad.net/ubuntu/+source/logrotate/+bug/1644996 

A know bug in Bionic. 

Greetz, 

Louis

Van: Viktor Trojanovic [mailto:viktor at troja.ch] 
Verzonden: woensdag 1 september 2021 11:56
Aan: L.P.H. van Belle
CC: samba at lists.samba.org
Onderwerp: Re: [Samba] Issues with log rotation



Hi Louis,  

Thanks for the quick response. 


Yes, that's on Bionic. What's more, it's in a container (lxc, privileged, works fine otherwise). 


I just tried to run the command, it gives me back: 


root at DC1:~#  sudo logrotate -d /etc/logrotate.conf
reading config file /etc/logrotate.conf
error: /etc/logrotate.conf:7 unknown group 'syslog'
removing last 0 log configs



Clearly, something is misconfigured here (although I never touched it, that came as default). I'll try to figure out what and report back. 


Thanks for the hint Louis! 


Vic




On Wed, 1 Sept 2021 at 11:21, L.P.H. van Belle via samba <samba at lists.samba.org> wrote:

Hai, 

This is on Bionic i think? That should not be a samba thing.. 
I had a look at my logrotate. Thats exactly the same as yours. 
On my debian and ubuntu servers. 

Only, i dont have these 2 in my smb.conf,
> log level = 1
> max log size = 10000

Only difference as far i can tell. Not that it "should" matter. 
But i seen failing logrotates also, just not in samba. 

What to you see if you run : 
logrotate -d /etc/logrotate.conf
Or 
logrotate -d -f /etc/logrotate.conf
-d debug
-f force 



Greetz, 

Louis


> -----Oorspronkelijk bericht-----
> Van: samba [mailto:samba-bounces at lists.samba.org] Namens 
> Viktor Trojanovic via samba
> Verzonden: woensdag 1 september 2021 11:06
> Aan: samba
> Onderwerp: [Samba] Issues with log rotation
> 
> Hi,
> 
> On one of my systems running Samba 4.10.18-Ubuntu (by Louis) logs in
> /var/log/samba are not being rotated which leads to the log 
> folder getting
> too big and bringing down the system.
> 
> I'm not sure what's going wrong here. In /etc/samba/smb.conf, I have
> 
> log level = 1
> max log size = 10000
> 
> I don't have any reference to the log file as I assume that's only
> necessary when deviating from the default. Clearly, log files in
> /var/log/samba are being generated even in the absence of this entry.
> 
> On my Ubuntu system, there is further a logrotate entry for Samba in
> /etc/logrotate.d/samba with the following content:
> 
> /var/log/samba/log.smbd {
>         weekly
>         missingok
>         rotate 7
>         postrotate
>                 [ ! -x /usr/bin/smbcontrol ] || [ ! -f
> /var/run/samba/smbd.pid ] || /usr/bin/smbcontrol smbd reload-config
>         endscript
>         compress
>         delaycompress
>         notifempty
> }
> 
> /var/log/samba/log.nmbd {
>         weekly
>         missingok
>         rotate 7
>         postrotate
>                 [ ! -x /usr/bin/smbcontrol ] || [ ! -f
> /var/run/samba/nmbd.pid ] || /usr/bin/smbcontrol nmbd reload-config
>         endscript
>         compress
>         delaycompress
>         notifempty
> }
> 
> /var/log/samba/log.samba {
>         weekly
>         missingok
>         rotate 7
>         postrotate
>                 if [ -d /run/systemd/system ] && command systemctl
> >/dev/null 2>&1 && systemctl is-active --quiet samba-ad-dc; then
>                         systemctl kill --kill-who all --signal=SIGHUP
> samba-ad-dc
>                 elif [ -f /var/run/samba/samba.pid ]; then
>                         # This only sends to main pid, See #803924
>                         kill -HUP `cat /var/run/samba/samba.pid`
>                 fi
>         endscript
>         compress
>         delaycompress
>         notifempty
> }
> 
> I'm not sure how this fits together with the entries in 
> smb.conf and if one
> depends on the other. But my understanding is that 
> /var/log/samba/log.samba
> should be rotated weekly and that only 7 files should be kept.
> 
> Anyway, clearly neither one nor the other is working as 
> log.samba is just
> growing and growing and there is not a single .old file for log.samba.
> 
> Any advice on how to mitigate this situation?
> 
> Thanks,
> Vic
> -- 
> To unsubscribe from this list go to the following URL and read the
> instructions:  https://lists.samba.org/mailman/options/samba
> 
> 


-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba



More information about the samba mailing list