Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 234594 - Xen daemon debug & qemu logs are not rotated
Xen daemon debug & qemu logs are not rotated
Product: Fedora
Classification: Fedora
Component: xen (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Berrange
Martin Jenner
Depends On:
  Show dependency treegraph
Reported: 2007-03-30 09:48 EDT by Mark McLoughlin
Modified: 2007-11-30 17:12 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-09-24 19:24:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
xen-logrotate.patch (1.49 KB, patch)
2007-05-04 12:18 EDT, Mark McLoughlin
no flags Details | Diff

  None (edit)
Description Mark McLoughlin 2007-03-30 09:48:54 EDT
+++ This bug was initially created as a clone of Bug #216239 +++

Description of problem:
XenD creates a number of log files under /var/log/xen. Only the xend.log file is
ever rotated - it uses python's builtin logging infrastructure to rotate. The
other files xend-debug.log and qemu-dm*.log are never rotated. The qemu-dm-*.log
are creted based on the PID of the QEMU process, so an ever increasing number of
log files accumulate over time.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Work with Xen on a machine for 6 months
Actual results:
Huge & large numbers of log files under /var/log/xen

Expected results:
A small number of logs of limited size 

Additional info:
Attaching a logrotate config file from OpenSuse Xen RP mthat would be a good
starting point for a fix.

-- Additional comment from berrange@redhat.com on 2006-11-17 17:15 EST --
Created an attachment (id=141542)
Log rotate config file
Comment 1 Mark McLoughlin 2007-03-30 09:50:09 EDT
Sounds reasonable, might change the logrotate config a little and try and get it
upstream too
Comment 2 Daniel Berrange 2007-04-24 13:53:53 EDT
Mark - any specific changes you think are relevant ? If not I'll just add the
attached logrotate file to the rawhide Xen RPM as is.
Comment 3 Mark McLoughlin 2007-05-04 10:31:07 EDT
 - We shouldn't logrotate xend.log, since xend already rotates it .. doing it
   twice with the same rotate config would just lead to weirdness

 - I'd leave xend-debug.log to the default policy in logrotate.conf - e.g.
   rotate weekly with 4 backups. It generally doesn't contain very useful stuff
   and would take a long time to build up to 1M.

 - copytruncate is what we want here since we can't get xend to close and 
   re-open xend-debug.log (since it's xend's stdout/stderr)

 - Not sure what to do about qemu-dm.*.log - maybe deleting them monthly as
   you suggest is enough, if you start a guest early on the first of the month
   and the logfile is immediately deleted while the guest is still running? I'd
   suggest that tmpwatch is what we really want here.

 - We should deal with xen-hotplug.log and domain-builder-ng.log in the same
   way as xend-debug.log. copytruncate is again needed for domain-builder-ng.log
   since xend (through libxc) will hold this file open. copytruncate isn't
   needed for xen-hotplug.log since it's only written to by short-lived 
   processes, but it's no harm really.

So, I suggest simply this:

/var/log/xen/xend-debug.log /var/log/xen/xen-hotplug-common.sh
/var/log/xen/domain-builder-ng.log {
Comment 4 Mark McLoughlin 2007-05-04 10:35:41 EDT
Hmm, typo:

/var/log/xen/xend-debug.log /var/log/xen/xen-hotplug.log
/var/log/xen/domain-builder-ng.log {
Comment 5 Mark McLoughlin 2007-05-04 12:18:10 EDT
Created attachment 154135 [details]
Comment 6 Mark McLoughlin 2007-05-04 12:20:12 EDT
Okay, to do the tmpwatch thing with qemu-dm, we'd have to move the logs into a
dir of their own. Let's just do the monthly thing.

Re-assigning to dan to include in the next build ...

Don't forget to mark it %config(noreplace)
Comment 7 Red Hat Bugzilla 2007-07-24 20:06:52 EDT
change QA contact
Comment 8 Daniel Berrange 2007-09-24 19:24:13 EDT
Addressed in rawhide

* Tue Jun 12 2007 Daniel P. Berrange <berrange@redhat.com> - 3.1.0-2.fc8
- Add logrotate configuration for all xen related logs

Note You need to log in before you can comment on or make changes to this bug.