Bug 14360 - RFE: samba logrotate script
RFE: samba logrotate script
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: samba (Show other bugs)
7.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Trond Eivind Glomsrxd
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-07-21 04:45 EDT by giulioo
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-07-21 14:17:07 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 giulioo 2000-07-21 04:45:32 EDT
Before 2.0.6 samba didn't reopen logs after an HUP.
In 2.0.6 this has been taken care of, but it still fails reopening the 
logs for active connections.

Example:
1) Stop samba, delete all logs, start samba
2) From a win box, <machine>,  click on a samba share, and do nothing -> a 
<machine>.log file is created
3) move the <machine>.log to <machine>.log.1
4) killall -HUP smbd nmbd
5) From the same win box click on another share -> <machine>.log.1 is used.
6) smbstatus and then kill the PID of <machine>
7) from the win box click on a samba share -> a new <machine>.log is 
created/used.

This causes problems after logrotate is run if there were active 
connections, especially if someone decided to compress logs.

To fix this I have always used logrotate's "copytruncate" option in samba 
logrotate script, even if the man page of logrotate says there's a 
drawback using this option.
Maybe you could add "copytruncate" commented out in samba logrotate 
script, so that if someone has the logs not properly rotated he has a 
quick way to fix it.

ie:
/etc/logrotate.d/samba

/var/log/samba/*.log {
    notifempty
    missingok
# try uncommenting 'copytruncate' if logs are not rotated properly,
# read the logrotate man page for this option effect.
#   copytruncate
    sharedscripts
    postrotate
        /bin/kill -HUP `cat /var/lock/samba/*.pid 2> /dev/null` 
2> /dev/null ||
true
    endscript
}
Comment 1 Glen Foster 2000-07-21 14:17:05 EDT
This defect is considered MUST-FIX for Winston Beta-5
Comment 2 Bill Nottingham 2000-07-21 14:22:56 EDT
copytruncate is added as of samba-2.0.7-17.

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