Bug 14360 - RFE: samba logrotate script
Summary: RFE: samba logrotate script
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: samba
Version: 7.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Trond Eivind Glomsrxd
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-07-21 08:45 UTC by giulioo
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-07-21 18:17:07 UTC
Embargoed:


Attachments (Terms of Use)

Description giulioo 2000-07-21 08:45:32 UTC
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 18:17:05 UTC
This defect is considered MUST-FIX for Winston Beta-5

Comment 2 Bill Nottingham 2000-07-21 18:22:56 UTC
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.