Bug 11927 - Samba doesn't need logrotate; doesn't work anyway
Samba doesn't need logrotate; doesn't work anyway
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: samba (Show other bugs)
6.1
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Trond Eivind Glomsrxd
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-06-06 11:37 EDT by vek
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-06-06 16:07:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description vek 2000-06-06 11:37:35 EDT
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 16:07:00 EDT
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 14:48:11 EDT
samba logrotation problems should be fixed as of samba-2.0.7-16 and
logrotate-3.4.

Note You need to log in before you can comment on or make changes to this bug.