The Samba-Bugzilla – Bug 6213
Feature request: Log rotation mechanism
Last modified: 2016-10-13 03:42:03 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.
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.
So what should we do with this bug?
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.
Ekacnet, do you still need this?
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
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.
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.