Tinc Log rotation fails

jvess at hostgator.com jvess at hostgator.com
Thu Nov 29 15:07:48 CET 2012


Hello,

As another option, You may want to use the "copytruncate" flag within your logrotate configuration as it does not require the service writing the log to take any action.
Though it warns about a small window of data loss, In practice the issue hardly ever is presented unless you're writing at an excessive rate to the file.

       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 can not 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  log-
              ging  data  might be lost.  When this option is used, the create
              option will have no effect, as the old log file stays in  place.

Thanks,
James

----- Original Message -----
From: "Guus Sliepen" <guus at tinc-vpn.org>
To: tinc at tinc-vpn.org
Cc: "Chris Beatty" <Chris.Beatty at DBAdirect.com>
Sent: Thursday, November 29, 2012 7:25:51 AM
Subject: Re: Tinc Log rotation fails

On Thu, Nov 29, 2012 at 12:58:40PM +0000, Kassemos, David wrote:

> This may have already been addressed, and I apologize if it has, but here is my issue.
> 
> I have separated the TINCD log from syslog to isolate the VPN activity.
> By starting with daemon with the  --logfile= switch
> 
> It seems to work fine except that once log rotation takes place, the daemon does not recreate the log, nor will it write to the new log even if an empty file is put into place.
> 
> The only way to re-establish the log writing is to restart the tincd service.
> 
> Any help on this issue would be greatly appreciated.

You should send a HUP signal to the tinc daemon after you have rotated the
logs, otherwise tinc keeps writing to the old log file. For example, if you use
logrotate, and want daily rotation up to one week, then add this to logrotate.conf:

/var/log/tinc.netname.log {
	rotate 7
	daily
	postrotate
		/usr/sbin/tincd -n netname -kHUP
	endscript
}

Or if you are using tinc 1.1, use "/usr/sbin/tincctl -n netname reload"
instead. If that still doesn't work, let me know.

-- 
Met vriendelijke groet / with kind regards,
     Guus Sliepen <guus at tinc-vpn.org>

_______________________________________________
tinc mailing list
tinc at tinc-vpn.org
http://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc


More information about the tinc mailing list