Bug 1285958

Summary: [GlusterD]: NFS service not running after layered installation of RHGS on RHEL7.x
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Byreddy <bsrirama>
Component: glusterdAssignee: Kaushal <kaushal>
Status: CLOSED ERRATA QA Contact: Byreddy <bsrirama>
Severity: high Docs Contact:
Priority: unspecified    
Version: rhgs-3.1CC: amukherj, asrivast, bmohanra, devops, dmoessne, kaushal, nlevinki, sasundar, vbellur
Target Milestone: ---Keywords: ZStream
Target Release: RHGS 3.1.2   
Hardware: x86_64   
OS: Linux   
Whiteboard: glusterd
Fixed In Version: glusterfs-3.7.5-8 Doc Type: Bug Fix
Doc Text:
Previously, rpcbind service did not start automatically after a layered installation on Red Hat Enterprise Linux 7. Due to this, GlusterFS NFS did not run after a reboot. With this fix, the GlusterD systemd unit was updated to explicitly require the rpcbind service. The GlusterFS NFS service now starts correctly on reboot.
Story Points: ---
Clone Of: 1282915 Environment:
RHEL 7
Last Closed: 2016-03-01 06:03:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1282915    
Bug Blocks: 1260783    

Description Byreddy 2015-11-27 04:12:15 UTC
+++ This bug was initially created as a clone of Bug #1282915 +++

Description of problem: Gluster does not reload gracefully upon server restart


Version-Release number of selected component (if applicable):
3.2+

How reproducible:
     

Steps to Reproduce:
1. Install GlusterFS as per docs on Centos7.
2. Create and start volume.
3. Restart server.

Actual results:
rpcbind service will not be active.

Expected results:
gluster will have registered with rpcbind

Additional info:

/usr/lib/systemd/system/glusterd.service has the following:
"[Unit]
Description=GlusterFS, a clustered file-system server
After=network.target rpcbind.service
Before=network-online.target"

Changing to:
[Unit]
Description=GlusterFS, a clustered file-system server
Requires=rpcbind.service
After=network.target 
Before=network-online.target

Corrects the issue.

--- Additional comment from Red Hat Bugzilla Rules Engine on 2015-11-17 14:29:40 EST ---

This bug is automatically being proposed for the current z-stream release of Red Hat Gluster Storage 3 by setting the release flag 'rhgs‑3.1.z' to '?'. 

If this bug should be proposed for a different release, please manually change the proposed release flag.

--- Additional comment from Kaushal on 2015-11-18 00:55:39 EST ---

Thanks for reporting this. Turns out we've misunderstood the meaning of the `After` option.

According to the systemd.unit(5) man page, the `After` option only sets up ordering. If unit foo.service has the option `After=bar.service`, the option only ensures that if both foo and bar are started together, foo is started after bar. It doesn't ensure that starting only foo starts bar.

The `Requires` option only sets up the requirement, but doesn't set up ordering. If foo.service `Requires` bar.service, it is only guaranteed that starting foo will also start bar, but not necessarily in order.

The man page suggests that if a unit requires that another unit be started before itself, then both `After` and `Requires` must be used.

I've submitted a change for review that fixes this at http://review.gluster.org/12605

--- Additional comment from Vijay Bellur on 2015-11-18 05:21:10 EST ---

COMMIT: http://review.gluster.org/12605 committed in master by Atin Mukherjee (amukherj) 
------
commit 23440a73bc348bbc3bb43ec397f0639ee45865fc
Author: Kaushal M <kaushal>
Date:   Wed Nov 18 11:21:13 2015 +0530

    glusterd.service: Ensure rpcbind is started before glusterd
    
    Having the rpcbind.service under the `After` option only ensures that
    glusterd.service is started after rpcbind.service if both are
    enabled/started at the same time. It doesn't ensure that starting
    glusterd.service will start rpcbind.service.
    
    The systemd.unit(5) man page suggests to use both the `Requires` and
    `After` options to ensure that rpcbind is started before glusterd,
    whenever glusterd is started.
    
    BUG: 1282915
    Change-Id: Iee69965486be08711299aba235f7b00c3e2fe7e9
    Signed-off-by: Kaushal M <kaushal>
    Reviewed-on: http://review.gluster.org/12605
    Reviewed-by: Atin Mukherjee <amukherj>
    Reviewed-by: Anand Nekkunti <anekkunt>
    Tested-by: Gluster Build System <jenkins.com>
    Tested-by: NetBSD Build System <jenkins.org>

Comment 1 Byreddy 2015-11-27 04:21:42 UTC
Issue:
======
After layered installation of RHGS3.1.2 on RHEL7.1/2,
Created a sample volume ( Distributed ) and observed that **NFS SERVICE** not running in the volume status 


Steps to reproduce:
===================
1. Install RHEL7.2 [OR] RHEL7.1 server
2. Do layered installation of RHGS //latest 3.1.2 OR 3.1.1
3. Start the glusterd 
4. Create a sample distributed volume 
5. Start the volume 
6. Check for NFS service in the volume status // it won't be running.

This issue is always reproducible with layered installation on RHE7.x

Comment 4 Kaushal 2015-11-27 09:07:03 UTC
Backport posted for review at https://code.engineering.redhat.com/gerrit/62484

Comment 5 Byreddy 2015-12-01 10:58:50 UTC
Done the Layered installation of  RHGS ON RHEL7.2  using the  version glusterfs-3.7.5-8 and done volume creation, everything worked fine ( NFS and rpcbind service  was running )

Moving to verified state

Comment 7 errata-xmlrpc 2016-03-01 06:03:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0193.html