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