Sandro Bonazzola has uploaded a new change for review.

Change subject: packaging: services: don't enable services on install
......................................................................

packaging: services: don't enable services on install

Avoid to enable HA services automatically after
rpm install.
It should be done by hosted-engine --deploy.

Change-Id: I9064a8a7bc28d0e581f2311d11b9fdca375dd3b5
Related-To: https://bugzilla.redhat.com/1066373
Signed-off-by: Sandro Bonazzola <[email protected]>
---
M ovirt-hosted-engine-ha.spec.in
1 file changed, 10 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-ha 
refs/changes/21/25321/1

diff --git a/ovirt-hosted-engine-ha.spec.in b/ovirt-hosted-engine-ha.spec.in
index aa0e9a4..0c745c3 100644
--- a/ovirt-hosted-engine-ha.spec.in
+++ b/ovirt-hosted-engine-ha.spec.in
@@ -53,9 +53,11 @@
 Requires:       vdsm >= 4.12.2
 Requires:       vdsm-cli >= 4.12.2
 Requires:       vdsm-python >= 4.12.2
+
 BuildRequires:  python2-devel
 
 %if 0%{?with_systemd}
+%systemd_requires
 BuildRequires:  systemd
 %endif
 
@@ -144,17 +146,21 @@
 
 %post
 %if 0%{?with_systemd}
+#Set service presets in any case covering install and update.
 %systemd_post ovirt-ha-agent.service
 %systemd_post ovirt-ha-broker.service
-%else
 if [ "$1" -eq 1 ] ; then
-    /sbin/chkconfig --add ovirt-ha-agent
-    /sbin/chkconfig --add ovirt-ha-broker
+#We don't want the service to be started by default before the system
+#is configured and Hosted Engine VM deployed on a fresh install.
+#Avoid to have the daemon running after yum install and reboot.
+    /usr/bin/systemctl --no-reload disable ovirt-ha-agent.service
+    /usr/bin/systemctl --no-reload disable ovirt-ha-broker.service
 fi
 %endif
 
 
 %preun
+#stop and disable services only on remove
 %if 0%{?with_systemd}
 %systemd_preun ovirt-ha-agent.service
 %systemd_preun ovirt-ha-broker.service
@@ -170,6 +176,7 @@
 
 
 %postun
+#restart services on update if they're already running
 %if 0%{?with_systemd}
 %systemd_postun_with_restart ovirt-ha-agent.service
 %systemd_postun_with_restart ovirt-ha-broker.service


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9064a8a7bc28d0e581f2311d11b9fdca375dd3b5
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-hosted-engine-ha
Gerrit-Branch: ovirt-hosted-engine-ha-1.0
Gerrit-Owner: Sandro Bonazzola <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to