Hi! I have one problem with my logrotate. Samba version: Samba 4 7.7 (compilated) S.O.: Ubuntu 14.04 /16.04 Samba logs file: /opt/samba/var/ Logrotate File: cat /etc/logrotate.d/samba -- /opt/samba/var/log.samba { rotate 10 daily compress dateext size 100M nomail missingok notifempty create 644 root root #postrotate # systemctl stop samba &> /dev/null # systemctl start samba &> /dev/null #endscript } -- My problem is, when logrotate is executed, log is rotate but after , don't log messages anymore, log.samba is was"zero"., is need restart in samba, then log message is back. Any idea? Regards;
More information: smb.conf about audit.. log level = 1 auth_audit:3 max log size = 5000 Regards; On 14-05-2018 15:56, Carlos wrote:> Hi! > > I have one problem with my logrotate. > > Samba version: > > Samba 4 7.7 (compilated) > > S.O.: > > Ubuntu 14.04 /16.04 > > Samba logs file: > > /opt/samba/var/ > > Logrotate File: > > cat /etc/logrotate.d/samba > > -- > > /opt/samba/var/log.samba > > { > rotate 10 > daily > compress > dateext > size 100M > nomail > missingok > notifempty > create 644 root root > #postrotate > # systemctl stop samba &> /dev/null > # systemctl start samba &> /dev/null > #endscript > } > > -- > > > My problem is, when logrotate is executed, log is rotate but after , > don't log messages anymore, log.samba is was"zero"., is need restart > in samba, then log message is back. > > > Any idea? > > > Regards; >
Am 14.05.2018 um 20:56 schrieb Carlos via samba:> /opt/samba/var/log.samba > > { > rotate 10 > daily > compress > dateext > size 100M > nomail > missingok > notifempty > create 644 root root > #postrotate > # systemctl stop samba &> /dev/null > # systemctl start samba &> /dev/null > #endscript > } > > -- > > > My problem is, when logrotate is executed, log is rotate but after , > don't log messages anymore, log.samba is was"zero"., is need restart in > samba, then log message is backthat's why postrotate and SIGHUP exists a proper systemd unit should have ExecReload if not make a drop-in: /etc/systemd/system/samba.service.d/reload.conf [Service] ExecReload=/usr/bin/kill -HUP $MAINPID after create folder and file: systemctl daemon-reload stop/sart would be wrong anyways - that's what RESTART is for
Am 14.05.2018 um 21:08 schrieb Reindl Harald via samba:> Am 14.05.2018 um 20:56 schrieb Carlos via samba: >> /opt/samba/var/log.samba >> >> { >> rotate 10 >> daily >> compress >> dateext >> size 100M >> nomail >> missingok >> notifempty >> create 644 root root >> #postrotate >> # systemctl stop samba &> /dev/null >> # systemctl start samba &> /dev/null >> #endscript >> } >> >> -- >> >> >> My problem is, when logrotate is executed, log is rotate but after , >> don't log messages anymore, log.samba is was"zero"., is need restart in >> samba, then log message is back > > that's why postrotate and SIGHUP exists > a proper systemd unit should have ExecReload > > if not make a drop-in: /etc/systemd/system/samba.service.d/reload.conf > [Service] > ExecReload=/usr/bin/kill -HUP $MAINPID > > after create folder and file: systemctl daemon-reload > > stop/sart would be wrong anyways - that's what RESTART is forand proper distributions ship logrotate configs by default copytruncate Truncate the original log file in place after creating a copy, instead of moving the old log file and optionally creating a new one. It can be used when some program cannot be told to close its logfile and thus might continue writing (appending) to the previous log file forever. Note that there is a very small time slice between copying the file and truncating it, so some logging data might be lost. When this option is used, the create option will have no effect, as the old log file stays in place. [root at srv-rhsoft:~]$ cat /etc/logrotate.d/samba /var/log/samba/* { notifempty olddir /var/log/samba/old missingok sharedscripts copytruncate }