+++ 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): xen-3.0.3-8.el5 How reproducible: Always Steps to Reproduce: 1. Work with Xen on a machine for 6 months 2. 3. 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 on 2006-11-17 17:15 EST -- Created an attachment (id=141542) Log rotate config file
Sounds reasonable, might change the logrotate config a little and try and get it upstream too
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.
- 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 { notifempty missingok copytruncate }
Hmm, typo: /var/log/xen/xend-debug.log /var/log/xen/xen-hotplug.log /var/log/xen/domain-builder-ng.log { notifempty missingok copytruncate }
Created attachment 154135 [details] xen-logrotate.patch
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)
change QA contact
Addressed in rawhide * Tue Jun 12 2007 Daniel P. Berrange <berrange> - 3.1.0-2.fc8 - Add logrotate configuration for all xen related logs