mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
Change logrotate to be per-hypervisor logs
Having a single logrotate configuration file for all hypervisors did not work as logrotate would get confused if an hypervisor not supported on that platform was still listed. Simplest is to split the logrotate as separate per hypervisor files and change the spec file to only install the ones compiled in. * daemon/libvirtd.lxc.logrotate.in daemon/libvirtd.qemu.logrotate.in daemon/libvirtd.uml.logrotate.in: copy and split the original daemon/libvirtd.logrotate.in file * daemon/Makefile.am: update to support the different files and cleanup in sed suggested by Eric Blake * libvirt.spec.in: only install the relevant logrotate configs * daemon/.gitignore: update logrotate generated list
This commit is contained in:
parent
36d8e7d8d7
commit
89bf843a6d
2
daemon/.gitignore
vendored
2
daemon/.gitignore
vendored
@ -9,4 +9,4 @@ Makefile.in
|
|||||||
libvirt_qemud
|
libvirt_qemud
|
||||||
libvirtd
|
libvirtd
|
||||||
libvirtd.init
|
libvirtd.init
|
||||||
libvirtd.logrotate
|
libvirtd.*.logrotate
|
||||||
|
@ -25,7 +25,9 @@ EXTRA_DIST = \
|
|||||||
libvirtd.sasl \
|
libvirtd.sasl \
|
||||||
libvirtd.sysconf \
|
libvirtd.sysconf \
|
||||||
libvirtd.aug \
|
libvirtd.aug \
|
||||||
libvirtd.logrotate.in \
|
libvirtd.qemu.logrotate.in \
|
||||||
|
libvirtd.lxc.logrotate.in \
|
||||||
|
libvirtd.uml.logrotate.in \
|
||||||
test_libvirtd.aug \
|
test_libvirtd.aug \
|
||||||
$(AVAHI_SOURCES) \
|
$(AVAHI_SOURCES) \
|
||||||
$(DAEMON_SOURCES)
|
$(DAEMON_SOURCES)
|
||||||
@ -177,20 +179,37 @@ remote_dispatch_args.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
|
|||||||
remote_dispatch_ret.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
|
remote_dispatch_ret.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
|
||||||
perl -w $(srcdir)/remote_generate_stubs.pl -r $(REMOTE_PROTOCOL) > $@
|
perl -w $(srcdir)/remote_generate_stubs.pl -r $(REMOTE_PROTOCOL) > $@
|
||||||
|
|
||||||
BUILT_SOURCES += libvirtd.logrotate
|
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
|
||||||
|
libvirtd.uml.logrotate
|
||||||
|
|
||||||
libvirtd.logrotate: libvirtd.logrotate.in
|
BUILT_SOURCES += $(LOGROTATE_CONFS)
|
||||||
|
|
||||||
|
libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in
|
||||||
sed \
|
sed \
|
||||||
-e s!\@localstatedir\@!@localstatedir@!g \
|
-e 's![@]localstatedir[@]!$(localstatedir)!g' \
|
||||||
< $< > $@-t
|
< $< > $@-t
|
||||||
mv $@-t $@
|
mv $@-t $@
|
||||||
|
|
||||||
install-logrotate: libvirtd.logrotate
|
libvirtd.lxc.logrotate: libvirtd.lxc.logrotate.in
|
||||||
|
sed \
|
||||||
|
-e 's![@]localstatedir[@]!$(localstatedir)!g' \
|
||||||
|
< $< > $@-t
|
||||||
|
mv $@-t $@
|
||||||
|
|
||||||
|
libvirtd.uml.logrotate: libvirtd.uml.logrotate.in
|
||||||
|
sed \
|
||||||
|
-e 's![@]localstatedir[@]!$(localstatedir)!g' \
|
||||||
|
< $< > $@-t
|
||||||
|
mv $@-t $@
|
||||||
|
|
||||||
|
install-logrotate: $(LOGROTATE_CONFS)
|
||||||
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu/
|
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu/
|
||||||
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/lxc/
|
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/lxc/
|
||||||
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/uml/
|
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/uml/
|
||||||
mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/
|
mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/
|
||||||
$(INSTALL_DATA) $< $(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
|
||||||
|
|
||||||
if LIBVIRT_INIT_SCRIPT_RED_HAT
|
if LIBVIRT_INIT_SCRIPT_RED_HAT
|
||||||
install-init: libvirtd.init
|
install-init: libvirtd.init
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@localstatedir@/log/libvirt/qemu/*.log @localstatedir@/log/libvirt/uml/*.log @localstatedir@/log/libvirt/lxc/*.log {
|
@localstatedir@/log/libvirt/lxc/*.log {
|
||||||
weekly
|
weekly
|
||||||
missingok
|
missingok
|
||||||
rotate 4
|
rotate 4
|
9
daemon/libvirtd.qemu.logrotate.in
Normal file
9
daemon/libvirtd.qemu.logrotate.in
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
@localstatedir@/log/libvirt/qemu/*.log {
|
||||||
|
weekly
|
||||||
|
missingok
|
||||||
|
rotate 4
|
||||||
|
compress
|
||||||
|
delaycompress
|
||||||
|
copytruncate
|
||||||
|
minsize 100k
|
||||||
|
}
|
9
daemon/libvirtd.uml.logrotate.in
Normal file
9
daemon/libvirtd.uml.logrotate.in
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
@localstatedir@/log/libvirt/uml/*.log {
|
||||||
|
weekly
|
||||||
|
missingok
|
||||||
|
rotate 4
|
||||||
|
compress
|
||||||
|
delaycompress
|
||||||
|
copytruncate
|
||||||
|
minsize 100k
|
||||||
|
}
|
@ -668,16 +668,20 @@ fi
|
|||||||
%{_sysconfdir}/rc.d/init.d/libvirtd
|
%{_sysconfdir}/rc.d/init.d/libvirtd
|
||||||
%config(noreplace) %{_sysconfdir}/sysconfig/libvirtd
|
%config(noreplace) %{_sysconfdir}/sysconfig/libvirtd
|
||||||
%config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf
|
%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/qemu/
|
||||||
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/
|
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/
|
||||||
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/
|
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/
|
||||||
|
|
||||||
%if %{with_qemu}
|
%if %{with_qemu}
|
||||||
%config(noreplace) %{_sysconfdir}/libvirt/qemu.conf
|
%config(noreplace) %{_sysconfdir}/libvirt/qemu.conf
|
||||||
|
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu
|
||||||
%endif
|
%endif
|
||||||
%if %{with_lxc}
|
%if %{with_lxc}
|
||||||
%config(noreplace) %{_sysconfdir}/libvirt/lxc.conf
|
%config(noreplace) %{_sysconfdir}/libvirt/lxc.conf
|
||||||
|
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.lxc
|
||||||
|
%endif
|
||||||
|
%if %{with_uml}
|
||||||
|
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.uml
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%dir %{_datadir}/libvirt/
|
%dir %{_datadir}/libvirt/
|
||||||
|
Loading…
Reference in New Issue
Block a user