Hi everyone again. I run tinc with the following command: /usr/sbin/tincd -d1 --logfile=/var/log/tinc.log That creates the file "/var/log/tinc.log" correctly and reports into it. Well, because I want to have a log file by day, I have created a logrotate file (/etc/logrotate.d/tinc) that contains the following lines: ----------------------------------------- /var/log/tinc.log { missingok rotate 7 daily create 0640 root root } ----------------------------------------- When the rotate is does, the file "tinc.log" is renamed to "tinc.log.1" and a new "tinc.log" is created but the problem is that tinc server goes on reporting in the "tinc.log.1" file and not in the new "tinc.log". Can tell me somebody how to can solve this without kill the tinc process? Best regards, Rams?s
On Fri, Apr 26, 2013 at 12:21:25PM +0200, Ramses II wrote:> Well, because I want to have a log file by day, I have created a logrotate > file (/etc/logrotate.d/tinc) that contains the following lines: > > ----------------------------------------- > /var/log/tinc.log { > missingok > rotate 7 > daily > create 0640 root rootAdd the following: postrotate kill -HUP `cat /var/run/tinc.pid` endscript> } > ------------------------------------------- Met vriendelijke groet / with kind regards, Guus Sliepen <guus at tinc-vpn.org> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: <http://www.tinc-vpn.org/pipermail/tinc/attachments/20130426/216ebfab/attachment.pgp>
Hi Guus, -----Mensaje original----- De: tinc-bounces at tinc-vpn.org [mailto:tinc-bounces at tinc-vpn.org] En nombre de Guus Sliepen Enviado el: viernes, 26 de abril de 2013 12:43 Para: tinc at tinc-vpn.org Asunto: Re: Problem with tinc.log and logrotate. On Fri, Apr 26, 2013 at 12:21:25PM +0200, Ramses II wrote:> Well, because I want to have a log file by day, I have created a > logrotate file (/etc/logrotate.d/tinc) that contains the following lines: > > ----------------------------------------- > /var/log/tinc.log { > missingok > rotate 7 > daily > create 0640 root rootAdd the following: postrotate kill -HUP `cat /var/run/tinc.pid` endscript> } > -----------------------------------------Now I have the following in logrotate file (tinc): ----------------------------------------- /var/log/tinc.log { missingok rotate 7 daily create 0640 root root postrotate kill -HUP `cat /var/run/tinc.pid` endscript } ----------------------------------------- I run "logrotate -f /etc/logrotate.d/tinc" and the same situation, creates the new "tinc.log" but it goes report in the "tinc.log.4" file: ----------- tinc.log.4 ------------------ . . 1366973321 tinc[14882]: Got HUP signal . . ----------------------------------------- Another idea? Best regards, Rams?s
On Fri, Apr 26, 2013 at 01:05:10PM +0200, Ramses II wrote:> Now I have the following in logrotate file (tinc): > > /var/log/tinc.log {[...]> postrotate > kill -HUP `cat /var/run/tinc.pid` > endscript > } > > I run "logrotate -f /etc/logrotate.d/tinc" and the same situation, creates > the new "tinc.log" but it goes report in the "tinc.log.4" file: > > ----------- tinc.log.4 ------------------ > . > . > 1366973321 tinc[14882]: Got HUP signal > . > . > -----------------------------------------The "Got HUP signal" message will always end up in the old log. Which version of tinc are you running? You need 1.0.15 or later for this to work correctly. -- Met vriendelijke groet / with kind regards, Guus Sliepen <guus at tinc-vpn.org> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: <http://www.tinc-vpn.org/pipermail/tinc/attachments/20130426/02dbbc7c/attachment.pgp>