Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

samba.log.old problem #1895

renatopancheri opened this issue Sep 11, 2019 · 0 comments


Copy link

commented Sep 11, 2019


i have a problem with the samba internal rotation of logs:
i have default configuration of smb.conf with the params

log file = /var/log/samba/samba.log
max log size = 100000

this should put all the old logs in

but on some of my Zentyal ADs the samba.log.old file instead of growing in size every time there is a rotation the file is deleted and rewritten, the biggest problem is that samba processes do not close the file descriptors of the deleted samba.log.old file, this causes space on disk not being reclaimed...
I discovered this because df and du commands were not reporting the same space usage and
lsof reported lots of file descriptors of samba.log.old, restarting samba-ad-dc service solves (temporary) the problem.

I understand this is a samba issue and not exactly a Zentyal one,
my suggestion is to change the default of smb.conf so to restore the ubuntu default
log file = /var/log/samba/log.%m

this way the rotation is gonna be done by logrotate with the file /etc/logrotate.d/samba:

/var/log/samba/log.samba {
                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/ ]; then
                        # This only sends to main pid, See #803924
                        kill -HUP `cat /var/run/samba/`

While right now since the default of "log file" in smb.conf has been changed this is not being used.

I'm open to suggestions of other ways to solve my problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.