Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 188807 - /etc/logrotate.d/elog-save-summary changes
Summary: /etc/logrotate.d/elog-save-summary changes
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - External Interaction (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 181949
  Show dependency tree
 
Reported: 2007-08-14 11:47 UTC by Duncan
Modified: 2008-02-04 17:20 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Duncan 2007-08-14 11:47:02 UTC
Suggestion (pseudo-patch):

 /var/log/portage/elog/summary.log {
       missingok
+      nocreate
+      delaycompress
 }

The reasoning is this:

+ nocreate since portage automatically creates the file when it needs it.  This saves having (and possibly rotating) the empty logfile around.

+ delaycompress to avoid a potential race condition, should it happen that portage is writing to the file at the time logrotate tries to move the file out from under it.  The first rotation out won't be compressed, but additional rotations will be.  By the time a second rotation comes around, any instances of portage that had the old file open when it was initially rotated should have long completed, so compression will be quite safe.

BTW, I don't know where to put this but it's related so might as well mention it here. I have a working logrotate configuration to handle the emerge output logs (/var/log/portage/*.log I guess would be the default).  This is tough since they change names every time and logrotate doesn't normally handle that, but it's possible to work around that using a somewhat convoluted config with an unchanging (zero byte) trigger file, some scripting, and a multi-stage rotation process, which is exactly how I handle it.  At present there's some stuff hard coded that will need "genericised".  Still, it was useful and non-trivial enough here that there's no reason others should do without or have to duplicate the work.  If there's interest, I'll work on it and submit it (new bug) after I get something semi-suitable.  Take a look at (otherwise unrelated) bug #123380 if you'd like to see the work quality you could expect.
Comment 1 Zac Medico gentoo-dev 2007-08-15 04:53:12 UTC
(In reply to comment #0)
> Suggestion (pseudo-patch):
> 
>  /var/log/portage/elog/summary.log {
>        missingok
> +      nocreate
> +      delaycompress
>  }

Thanks, that's in svn r7610.

> BTW, I don't know where to put this but it's related so might as well mention
> it here. I have a working logrotate configuration to handle the emerge output
> logs (/var/log/portage/*.log I guess would be the default).

Personally, I just delete those logs when the get above a certain ange using find -mtime. I suppose that real rotation would be nice. Go ahead and file a bug if you like and we'll take at what you've got.
Comment 2 Zac Medico gentoo-dev 2007-08-16 00:45:32 UTC
This has been released in 2.1.3.6.