17b94a
From 850d5418fb48417d94ab17e565b2184ba951ccbe Mon Sep 17 00:00:00 2001
17b94a
From: Mohit Agrawal <moagrawa@redhat.com>
17b94a
Date: Wed, 17 Apr 2019 18:04:44 +0530
17b94a
Subject: [PATCH 113/124] spec: Glusterd did not start by default after node
17b94a
 reboot
17b94a
17b94a
Problem: After install gluster rpms glusterd service is not enabled
17b94a
         so systemctl status is showing "disabled"
17b94a
17b94a
Solution: Update glusterfs.spec.in to enable glusterd after install
17b94a
          gluster rpms
17b94a
17b94a
label: DOWNSTREAM ONLY
17b94a
BUG: 1699835
17b94a
17b94a
Change-Id: Ied9be5dfb1bf3bda24868722b1fbd77cb1c1d18c
17b94a
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
17b94a
Reviewed-on: https://code.engineering.redhat.com/gerrit/168168
17b94a
Reviewed-by: Kaleb Keithley <kkeithle@redhat.com>
17b94a
Tested-by: RHGS Build Bot <nigelb@redhat.com>
17b94a
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
17b94a
---
17b94a
 glusterfs.spec.in | 10 ++++++----
17b94a
 1 file changed, 6 insertions(+), 4 deletions(-)
17b94a
17b94a
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
17b94a
index cb17eaa..ba095b7 100644
17b94a
--- a/glusterfs.spec.in
17b94a
+++ b/glusterfs.spec.in
17b94a
@@ -168,6 +168,8 @@
17b94a
 %endif
17b94a
 
17b94a
 %if ( 0%{?_with_systemd:1} )
17b94a
+%global service_enable()   /bin/systemctl --quiet enable %1.service || : \
17b94a
+%{nil}
17b94a
 %global service_start()   /bin/systemctl --quiet start %1.service || : \
17b94a
 %{nil}
17b94a
 %global service_stop()    /bin/systemctl --quiet stop %1.service || :\
17b94a
@@ -181,7 +183,7 @@
17b94a
 %global glustereventsd_svcfile %{_unitdir}/glustereventsd.service
17b94a
 %global glusterfssharedstorage_svcfile %{_unitdir}/glusterfssharedstorage.service
17b94a
 %else
17b94a
-%global systemd_post()  /sbin/chkconfig --add %1 >/dev/null 2>&1 || : \
17b94a
+%global service_enable()  /sbin/chkconfig --add %1 >/dev/null 2>&1 || : \
17b94a
 %{nil}
17b94a
 %global systemd_preun() /sbin/chkconfig --del %1 >/dev/null 2>&1 || : \
17b94a
 %{nil}
17b94a
@@ -926,7 +928,7 @@ exit 0
17b94a
 
17b94a
 %if ( 0%{!?_without_events:1} )
17b94a
 %post events
17b94a
-%systemd_post glustereventsd
17b94a
+%service_enable glustereventsd
17b94a
 %endif
17b94a
 
17b94a
 %if ( 0%{!?_without_server:1} )
17b94a
@@ -951,9 +953,9 @@ exit 0
17b94a
 %if ( 0%{!?_without_server:1} )
17b94a
 %post server
17b94a
 # Legacy server
17b94a
-%systemd_post glusterd
17b94a
+%service_enable glusterd
17b94a
 %if ( 0%{_for_fedora_koji_builds} )
17b94a
-%systemd_post glusterfsd
17b94a
+%service_enable glusterfsd
17b94a
 %endif
17b94a
 # ".cmd_log_history" is renamed to "cmd_history.log" in GlusterFS-3.7 .
17b94a
 # While upgrading glusterfs-server package form GlusterFS version <= 3.6 to
17b94a
-- 
17b94a
1.8.3.1
17b94a