Douglas Schilling Landgraf has uploaded a new change for review.
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(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 15 insertions(+), 9 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/76/23876/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 6ff477e..d4ebc43 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -612,12 +612,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(a)/metadata.log
-touch %{buildroot}@VDSMLOGDIR(a)/mom.log
-touch %{buildroot}@VDSMLOGDIR(a)/supervdsm.log
-touch %{buildroot}@VDSMLOGDIR(a)/vdsm.log
+touch %{buildroot}@VDSMLOGDIR(a)/{metadata.log,mom.log,supervdsm.log,vdsm.log}
# Install the respawn utility
install -Dm 0755 init/sysvinit/respawn \
@@ -692,6 +690,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(a)/{metadata.log,mom.log,supervdsm.log,vdsm.log}
+chmod 0644 @VDSMLOGDIR(a)/{metadata.log,mom.log,supervdsm.log,vdsm.log}
+chown @VDSMUSER@:@VDSMGROUP@ @VDSMLOGDIR(a)/{metadata.log,mom.log,vdsm.log}
+chown root:root @VDSMLOGDIR(a)/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.
@@ -883,10 +889,10 @@
%endif
%dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@
-%config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR(a)/metadata.log
-%config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR(a)/mom.log
-%config %attr(0644, root, root) @VDSMLOGDIR(a)/supervdsm.log
-%config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR(a)/vdsm.log
+%ghost %config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR(a)/metadata.log
+%ghost %config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR(a)/mom.log
+%ghost %config %attr(0644, root, root) @VDSMLOGDIR(a)/supervdsm.log
+%ghost %config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR(a)/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/23876
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc8e62d5a0a6166c9141fe9d6016a525a3331694
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>