Change in vdsm[ovirt-3.3]: spec: do not remove vdsm logs when pkg removed

dougsland at redhat.com dougsland at redhat.com
Tue Feb 4 13:23:54 UTC 2014


Hello Yaniv Bronhaim, Dan Kenigsberg,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/24044

to review the following change.

Change subject: spec: do not remove vdsm logs when pkg removed
......................................................................

spec: do not remove vdsm logs when pkg removed

In the commits 4a07386 0b6035a we introduced the concept
of creating of metadata.log, mom.log, supervdsm.log and vdsm.log
logs during the rpm install and sets the proper
user/group. However, now when removing vdsm the logs are removed too
which is not the behaviour as before these commits. This patch will
add ghost macro in the spec to keep logs available when vdsm is removed.

Change-Id: Idc8e62d5a0a6166c9141fe9d6016a525a3331694
Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/23876
Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm.spec.in
1 file changed, 15 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/44/24044/1

diff --git a/vdsm.spec.in b/vdsm.spec.in
index 8d63591..f5142a9 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -567,12 +567,10 @@
 rm -rf %{buildroot}
 make DESTDIR=%{buildroot} install
 
-# Creating VDSM logs
+# Creating VDSM logs in this session to avoid rpmbuild
+# complain during the build
 install -dDm 0755 %{buildroot}@VDSMLOGDIR@
-touch %{buildroot}@VDSMLOGDIR@/metadata.log
-touch %{buildroot}@VDSMLOGDIR@/mom.log
-touch %{buildroot}@VDSMLOGDIR@/supervdsm.log
-touch %{buildroot}@VDSMLOGDIR@/vdsm.log
+touch %{buildroot}@VDSMLOGDIR@/{metadata.log,mom.log,supervdsm.log,vdsm.log}
 
 # Install the respawn utility
 install -Dm 0755 init/sysvinit/respawn \
@@ -652,6 +650,14 @@
 %{_bindir}/vdsm-tool sebool-config || :
 # set the vdsm "secret" password for libvirt
 %{_bindir}/vdsm-tool set-saslpasswd
+
+# After vdsm install we should create the logs files.
+# In the install session we create it but since we use
+# the ghost macro (in files session) the files are not included
+touch @VDSMLOGDIR@/{metadata.log,mom.log,supervdsm.log,vdsm.log}
+chmod 0644 @VDSMLOGDIR@/{metadata.log,mom.log,supervdsm.log,vdsm.log}
+chown @VDSMUSER@:@VDSMGROUP@ @VDSMLOGDIR@/{metadata.log,mom.log,vdsm.log}
+chown root:root @VDSMLOGDIR@/supervdsm.log
 
 # Have moved vdsm section in /etc/sysctl.conf to /etc/sysctl.d/vdsm.conf.
 # So Remove them if it is played with /etc/sysctl.conf.
@@ -844,10 +850,10 @@
 %endif
 
 %dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@
-%config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR@/metadata.log
-%config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR@/mom.log
-%config %attr(0644, root, root) @VDSMLOGDIR@/supervdsm.log
-%config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR@/vdsm.log
+%ghost %config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR@/metadata.log
+%ghost %config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR@/mom.log
+%ghost %config %attr(0644, root, root) @VDSMLOGDIR@/supervdsm.log
+%ghost %config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR@/vdsm.log
 %ghost %dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@/hsm-tasks
 %ghost %dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@/mnt
 %dir %{_libexecdir}/%{vdsm_name}


-- 
To view, visit http://gerrit.ovirt.org/24044
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc8e62d5a0a6166c9141fe9d6016a525a3331694
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>


More information about the vdsm-patches mailing list