Bug 12935 - No reliable way to reopen samba.log on an system without systemd
Summary: No reliable way to reopen samba.log on an system without systemd
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Other (show other bugs)
Version: 4.6.6
Hardware: All All
: P5 enhancement (vote)
Target Milestone: ---
Assignee: Andrew Bartlett
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-25 16:17 UTC by Achim Gottinger
Modified: 2017-07-25 19:50 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Achim Gottinger 2017-07-25 16:17:28 UTC
Hello,

As mentioned in the debian bugreport #803924 (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803924) an restart of the samba service is necessary to make it write to samba.log after an logrotation.

I'm running 4.6.6 on debian wheezy (build without systemd support). Sending an SIGHUP to the samba parent process with pid from /var/run/samba/samba.pid here in logrotates postrotate section does not work, the processes are still writing to /var/log/samba/log.samba.1 here until the samba-ad-dc service got restarted.

So I wrtite this report to request the "smbcontrol reopen-logs" extension to fix this issue on systems without systemd.

Thanks in advance,
Achim Gottinger
Comment 1 Giulio 2017-07-25 19:34:26 UTC
Have you tried the logrotate's "copytruncate" option?

Or, by hand

cp log.samba log.samba.1 
> log.samba
Comment 2 Achim Gottinger 2017-07-25 19:50:11 UTC
(In reply to Giulio from comment #1)
Great tip. Logrotation works fine with copytruncate.

Thank you very much Giulio!