On Mar 7, 2006, at 3:42 AM, Tomas Rudén wrote:
As it seems tracd keeps the same file open and continues to
write to it eaven after it has been renamed.

I use the following logrotate script successfully with Trac:

/var/log/apache2/*log /mnt/TracRoot/*/log/*log {
  missingok
  notifempty
  sharedscripts
  postrotate
  /etc/init.d/apache2 reload > /dev/null 2>&1 || true
  endscript
}

All of my Trac installations live under /mnt/TracRoot/<PROJECT_NAME>/

That script is taken directly from Gentoo, so YMMV with that particular init script call. In Gentoo, `/etc/init.d/apache2 reload` basically calls the following:

/usr/sbin/apache2 <assorted apache options here> -k graceful

"-k graceful" tells Apache to close all its daemons when their current request is completed, and to close and reopen all logfiles. Even though Trac isn't technically a part of Apache itself, mod_python seems to get the idea. The end result of running that is a new trac.log in /mnt/TracRoot/PROJECT/log as well as trac.log. [1-5].gz as I have logrotate setup to compress and keep five old logs.

I have no idea if that works if you're not using mod_python.

Hope that's helpful at least.

Best regards,
Zac Bedell_______________________________________________
Trac mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac

Reply via email to