mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 05:17:54 +03:00
Add logrotate support for libvirtd.log
As the file may grow quite a bit especially with debug turned on. * daemon/libvirtd.logrotate.in daemon/Makefile.am libvirt.spec.in: add new logrotate file for the daemon log
This commit is contained in:
parent
8ddf6d1e4e
commit
e7aeed0067
@ -32,6 +32,7 @@ EXTRA_DIST = \
|
||||
libvirtd.sasl \
|
||||
libvirtd.sysconf \
|
||||
libvirtd.aug \
|
||||
libvirtd.logrotate.in \
|
||||
libvirtd.qemu.logrotate.in \
|
||||
libvirtd.lxc.logrotate.in \
|
||||
libvirtd.uml.logrotate.in \
|
||||
@ -246,10 +247,16 @@ qemu_dispatch_ret.h: $(srcdir)/remote_generate_stubs.pl $(QEMU_PROTOCOL)
|
||||
$(AM_V_GEN)perl -w $(srcdir)/remote_generate_stubs.pl -r qemu $(QEMU_PROTOCOL) > $@
|
||||
|
||||
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
|
||||
libvirtd.uml.logrotate
|
||||
libvirtd.uml.logrotate libvirtd.logrotate
|
||||
|
||||
BUILT_SOURCES += $(LOGROTATE_CONFS)
|
||||
|
||||
libvirtd.logrotate: libvirtd.logrotate.in
|
||||
sed \
|
||||
-e 's![@]localstatedir[@]!$(localstatedir)!g' \
|
||||
< $< > $@-t
|
||||
mv $@-t $@
|
||||
|
||||
libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in
|
||||
sed \
|
||||
-e 's![@]localstatedir[@]!$(localstatedir)!g' \
|
||||
@ -273,6 +280,7 @@ install-logrotate: $(LOGROTATE_CONFS)
|
||||
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/lxc/
|
||||
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/uml/
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/
|
||||
$(INSTALL_DATA) libvirtd.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd
|
||||
$(INSTALL_DATA) libvirtd.qemu.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.qemu
|
||||
$(INSTALL_DATA) libvirtd.lxc.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.lxc
|
||||
$(INSTALL_DATA) libvirtd.uml.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.uml
|
||||
|
9
daemon/libvirtd.logrotate.in
Normal file
9
daemon/libvirtd.logrotate.in
Normal file
@ -0,0 +1,9 @@
|
||||
@localstatedir@/log/libvirt/libvirtd.log {
|
||||
weekly
|
||||
missingok
|
||||
rotate 4
|
||||
compress
|
||||
delaycompress
|
||||
copytruncate
|
||||
minsize 100k
|
||||
}
|
@ -865,6 +865,7 @@ fi
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/
|
||||
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd
|
||||
%if %{with_qemu}
|
||||
%config(noreplace) %{_sysconfdir}/libvirt/qemu.conf
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu
|
||||
|
Loading…
Reference in New Issue
Block a user