Bug 4676 - smbd continues writing to old logfile when logs are rotated (with SIGHUP)
smbd continues writing to old logfile when logs are rotated (with SIGHUP)
Status: RESOLVED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: File Services
3.0.25a
Other Linux
: P3 normal
: none
Assigned To: Samba Bugzilla Account
Samba QA Contact
http://bugs.debian.org/394770
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-03 07:41 UTC by Christian Perrier
Modified: 2012-05-07 18:02 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Perrier 2007-06-03 07:41:03 UTC
In Debian/Ubuntu, the samba packages include a logrotate chunk that allows logfiles (nmbd.log and smbd.log, which are the logfiles used by samba in the default setup) to be rotated weekly.

This is done with logrotate.

The entry for samba is:
/var/log/samba/log.smbd {
        weekly
        missingok
        rotate 7
        postrotate
                invoke-rc.d --quiet samba reload > /dev/null
        endscript
        compress
        notifempty
}

/var/log/samba/log.nmbd {
        weekly
        missingok
        rotate 7
        postrotate
                [ ! -f /var/run/samba/nmbd.pid ] || kill -HUP `cat /var/run/samba/nmbd.pid`
        endscript
        compress
        notifempty
}


However, our user in Debian bug #394770 noticed that smbd continues to write to the rotated file(s), named smbd.log.0, instead of writing to smbd.log

So, it seems that smbd does not close/reopen the logfile when stopped with SIGHUP.

Of course, I'm opened to any suggeston to improve this (except stop/start of the samba daemons when rotating the logfiles, of course)
Comment 1 Debian samba package maintainers (PUBLIC MAILING LIST) 2007-09-16 10:01:28 UTC
The very same bug is reported for winbind: see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=280420
Comment 2 Christian Perrier 2008-12-29 07:05:37 UTC
That bug seems to be away in 3.2.5 and 3.3.0. When I rotate logs on my Debian machine, with logrotate (and a SIGHUP signal), samba does not continue writing on old log files
Comment 3 Christian Perrier 2012-05-07 18:02:56 UTC
As I wrote in the bug log, this bug is fixed for ages...:-)