[libvirt] [PATCH] 526769 change logrotate config default to weekly

https://bugzilla.redhat.com/show_bug.cgi?id=526769 Current setup is daily with 7 backups so one week worth of logs per domain in /var/log/libvirt/qemu/*.log First a week worth of backup is a bit short, second for most domains the logs are really small, and with 7 backup files this directory gets crowded quickly. This patches changes to weekly, with 4 backups, so always a month worth of logs, and will nearly cut in half the number of entries in that directory. Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Fri, 2009-10-02 at 18:08 +0200, Daniel Veillard wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=526769
Current setup is daily with 7 backups so one week worth of logs per domain in /var/log/libvirt/qemu/*.log First a week worth of backup is a bit short, second for most domains the logs are really small, and with 7 backup files this directory gets crowded quickly.
This patches changes to weekly, with 4 backups, so always a month worth of logs, and will nearly cut in half the number of entries in that directory. ... diff --git a/daemon/libvirtd.logrotate.in b/daemon/libvirtd.logrotate.in index 9b42630..cdb399e 100644 --- a/daemon/libvirtd.logrotate.in +++ b/daemon/libvirtd.logrotate.in @@ -1,7 +1,7 @@ @localstatedir@/log/libvirt/qemu/*.log { - daily + weekly missingok - rotate 7 + rotate 4
Yep, I was starting to find daily rollover annoying. Weekly is much more sensible. ACK Cheers, Mark.

On Fri, Oct 02, 2009 at 06:08:41PM +0200, Daniel Veillard wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=526769
Current setup is daily with 7 backups so one week worth of logs per domain in /var/log/libvirt/qemu/*.log First a week worth of backup is a bit short, second for most domains the logs are really small, and with 7 backup files this directory gets crowded quickly.
This patches changes to weekly, with 4 backups, so always a month worth of logs, and will nearly cut in half the number of entries in that directory.
ACK, sounds good. I notice that file is long since missing rules for the equivalent /var/log/libvirt/uml/ /var/log/libvirt/lxc/ driver directories too Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Mon, Oct 05, 2009 at 01:37:57PM +0100, Daniel P. Berrange wrote:
On Fri, Oct 02, 2009 at 06:08:41PM +0200, Daniel Veillard wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=526769
Current setup is daily with 7 backups so one week worth of logs per domain in /var/log/libvirt/qemu/*.log First a week worth of backup is a bit short, second for most domains the logs are really small, and with 7 backup files this directory gets crowded quickly.
This patches changes to weekly, with 4 backups, so always a month worth of logs, and will nearly cut in half the number of entries in that directory.
ACK, sounds good.
I notice that file is long since missing rules for the equivalent
/var/log/libvirt/uml/ /var/log/libvirt/lxc/
driver directories too
Ah, good point, I added those before commiting ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Mon, 2009-10-05 at 17:07 +0200, Daniel Veillard wrote:
On Mon, Oct 05, 2009 at 01:37:57PM +0100, Daniel P. Berrange wrote:
On Fri, Oct 02, 2009 at 06:08:41PM +0200, Daniel Veillard wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=526769
Current setup is daily with 7 backups so one week worth of logs per domain in /var/log/libvirt/qemu/*.log First a week worth of backup is a bit short, second for most domains the logs are really small, and with 7 backup files this directory gets crowded quickly.
This patches changes to weekly, with 4 backups, so always a month worth of logs, and will nearly cut in half the number of entries in that directory.
ACK, sounds good.
I notice that file is long since missing rules for the equivalent
/var/log/libvirt/uml/ /var/log/libvirt/lxc/
driver directories too
Ah, good point, I added those before commiting !
Fate has conspired against you to yet again prove that there's no such thing as a safe change! :-) Patch on its way Cheers, Mark.

Otherwise logrotate barfs: error: error accessing /var/log/libvirt/uml: No such file or directory error: libvirtd:1 glob failed for /var/log/libvirt/uml/*.log error: found error in /var/log/libvirt/qemu/*.log /var/log/libvirt/uml/*.log /var/log/libvirt/lxc/*.log , skipping * qemud/Makefile.am: always create /var/log/libvirt/{lxc,uml} when installing the logrotate conf; not ideal, but easier than making the logrotate conf depend on which drivers are enabled --- daemon/Makefile.am | 2 ++ libvirt.spec.in | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 14f2e6a..26347d6 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -183,6 +183,8 @@ libvirtd.logrotate: libvirtd.logrotate.in install-logrotate: libvirtd.logrotate mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu/ + mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/lxc/ + mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/uml/ mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/ $(INSTALL_DATA) $< $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd diff --git a/libvirt.spec.in b/libvirt.spec.in index da3b2a7..ff397e6 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -623,6 +623,9 @@ fi %config(noreplace) %{_sysconfdir}/sysconfig/libvirtd %config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd +%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/ +%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/ +%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/ %if %{with_qemu} %config(noreplace) %{_sysconfdir}/libvirt/qemu.conf @@ -680,9 +683,6 @@ fi %endif %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/ -%if %{with_qemu} -%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/ -%endif %if %{with_xen_proxy} %attr(4755, root, root) %{_libexecdir}/libvirt_proxy -- 1.6.2.5

On Tue, Oct 06, 2009 at 01:52:47PM +0100, Mark McLoughlin wrote:
Otherwise logrotate barfs:
error: error accessing /var/log/libvirt/uml: No such file or directory error: libvirtd:1 glob failed for /var/log/libvirt/uml/*.log error: found error in /var/log/libvirt/qemu/*.log /var/log/libvirt/uml/*.log /var/log/libvirt/lxc/*.log , skipping
* qemud/Makefile.am: always create /var/log/libvirt/{lxc,uml} when installing the logrotate conf; not ideal, but easier than making the logrotate conf depend on which drivers are enabled
indeed, grumpf ! ACK, thanks !!! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Mark McLoughlin