Bug 11927

Summary: Samba doesn't need logrotate; doesn't work anyway
Product: [Retired] Red Hat Linux Reporter: vek
Component: sambaAssignee: Trond Eivind Glomsrxd <teg>
Status: CLOSED RAWHIDE QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 6.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-06-06 20:07:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description vek 2000-06-06 15:37:35 UTC
When trying to logrotate smabe log files the samba daemons are sent
a SIGHUP signal.  These daemons does not use SIGHUP for the usual
purpose, and the new log files are therefore not opened after they have
been rotated.

Then again, samba will rotate the logs by itself when the size reaches
the max log size as defined in smb.conf.



That is the case for RH6.1 but probably on 6.2 as well.


Villy

Comment 1 giulioo 2000-06-06 20:07:00 UTC
Actually the latest samba versions (2.0.6 and 2.0.7, maybe 2.0.5) should re-
open the logs on HUP, this is the documented behavior.

However, this does not always work, if a connection is already opened, it will 
keep logging to the old rotated log.

I kept submitting this problem to the samba list for a long time, then I 
decided to solve it on my own:
edit /etc/logrotate.d/samba and add "copytruncate"

/var/log/samba/log.nmb {
    copytruncate
    postrotate
        /usr/bin/killall -HUP nmbd
    endscript
}
 
/var/log/samba/log.smb {
    copytruncate
    postrotate
        /usr/bin/killall -HUP smbd
    endscript
}

This way the logs are rotated properly because they are truncated in place and 
not moved/renamed.

Samba rotates the log by size only if you tell it to do so.
And however, there is a bug in that too in versions < 2.0.7.




Comment 2 Bill Nottingham 2000-07-15 18:48:11 UTC
samba logrotation problems should be fixed as of samba-2.0.7-16 and
logrotate-3.4.