Bug 6213 - Feature request: Log rotation mechanism
Feature request: Log rotation mechanism
Status: NEW
Product: Samba 4.0
Classification: Unclassified
Component: Other
unspecified
Other Linux
: P3 enhancement
: ---
Assigned To: Andrew Bartlett
samba4-qa@samba.org
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-25 06:55 UTC by Matthieu Patou
Modified: 2016-10-13 03:42 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthieu Patou 2009-03-25 06:55:47 UTC
Samba3 and previous version had this cool feature that allow file rotating by moving the current log and sending an HUP signal to smbd father process.

With Samba4 this doesn't work anymore. After moving the file and sending a HUP signal to the samba father process old log are still written.

After some investigation, it appears that schedule_logs_reopen is called by the process upon the reception of the HUP signal. But the reopening of the log will only occur on the next time this process will write to the log (which can be quite long on a lightly used setup) and others samba process do not update the file descriptor of the log file.

A workaround for this problem is to send a HUP signal to all samba program. Once all the samba process have received the HUP then file log is reopen.
Comment 1 Andrew Bartlett 2009-03-26 16:46:50 UTC
Samba4 likes to avoid using signals as a communication mechanism - they have too many nasty side-effects.  We could allow this (for backward compatability), but the modern approach would be to have a utility like Samba3's smbcontrol send a message asking to rotate logs.
Comment 2 Matthias Dieter Wallnöfer 2009-06-19 15:21:36 UTC
So what should we do with this bug?
Comment 3 Matthias Dieter Wallnöfer 2010-02-13 13:11:55 UTC
I change this bug into a feature request since it's not really a bug. ekacnet, as far as I see, you want simply to have a comfortable mechanism to do a logfile rotation.
Comment 4 Matthias Dieter Wallnöfer 2010-11-21 03:58:05 UTC
Ekacnet, do you still need this?
Comment 5 Matthieu Patou 2010-11-21 04:31:30 UTC
Of course and if not me someone will need it (distros, for instance) the idea of a sambacontrol like is a good way to achieve this 
Comment 6 Andrew Bartlett 2010-11-21 04:37:54 UTC
It is my intention to retain this facility from the s3 debug system if/when I get a chance to merge the remainder of the debug systems.

Comment 7 Matthieu Patou 2010-11-21 05:20:27 UTC
And I think it's a good idea, of course so far I managed to do it in another way but we definitely need this feature please do not close this request.