Change in vdsm[ovirt-3.2]: vdsmd.init: do not use previous libvirt logrotate
dougsland at redhat.com
dougsland at redhat.com
Wed Jul 10 04:53:11 UTC 2013
Douglas Schilling Landgraf has uploaded a new change for review.
Change subject: vdsmd.init: do not use previous libvirt logrotate
......................................................................
vdsmd.init: do not use previous libvirt logrotate
In the past VDSM have been creating /var/log/libvirtd.log to track libvirt
calls and also add rule for such file into /etc/logrotate.d/libvirtd.
However, now VDSM uses /var/log/libvirt/libvirtd.log (commit fe01963f)
and should replace any previous conf on /etc/logrotate.d/libvirtd
with VDSM suggestions.
Change-Id: Iaa9707d892bb03a029300f62ae1ed204cea52486
Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
---
M vdsm.spec.in
M vdsm/vdsmd.init.in
2 files changed, 8 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/47/16647/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 8c00001..ee12bd1 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -561,10 +561,14 @@
/bin/sed -i -e "/${start_conf_section}/,/${end_conf_section}/d" \
-e "/${by_vdsm}/d" \
%{_sysconfdir}/libvirt/libvirtd.conf \
+ %{_sysconfdir}/logrotate.d/libvirtd \
%{_sysconfdir}/libvirt/qemu.conf \
%{_sysconfdir}/sysconfig/libvirtd \
%{_sysconfdir}/sysctl.conf \
%{_sysconfdir}/libvirt/qemu-sanlock.conf
+
+ # Restoring backuped logrotate.d/libvirtd
+ /bin/sed -i -e 's/# VDSM backup//' %{_sysconfdir}/logrotate.d/libvirtd
fi
%if 0%{?rhel}
diff --git a/vdsm/vdsmd.init.in b/vdsm/vdsmd.init.in
index c8223d3..138af82 100755
--- a/vdsm/vdsmd.init.in
+++ b/vdsm/vdsmd.init.in
@@ -339,7 +339,7 @@
local llogr=/etc/logrotate.d/libvirtd
local stanza=`mktemp`
/bin/cat > "$stanza" <<EOF
-# vdsm
+## beginning of configuration section by vdsm
/var/log/libvirtd.log {
rotate 100
missingok
@@ -350,8 +350,10 @@
uncompresscmd /usr/bin/unxz
compressext .xz
}
-# end vdsm
+## end of configuration section by vdsm
EOF
+ # Backup (comment) original logrotate.d/libvirtd
+ /bin/sed -i 's/^/# VDSM backup/' "$llogr"
/bin/sed -e "/# vdsm/,/# end vdsm/d" "$llogr" >> "$stanza"
local oldmod=`/usr/bin/stat --format=%a "$llogr"`
/bin/mv "$stanza" "$llogr"
--
To view, visit http://gerrit.ovirt.org/16647
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa9707d892bb03a029300f62ae1ed204cea52486
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.2
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>
More information about the vdsm-patches
mailing list