Bug 1533342

Summary: Syntactical errors in hook scripts for managing SELinux context on bricks
Product: [Community] GlusterFS Reporter: Anoop C S <anoopcs>
Component: scriptsAssignee: Milan Zink <mzink>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: mainlineCC: amukherj, bugs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: glusterfs-v4.1.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1546627 (view as bug list) Environment:
Last Closed: 2018-06-20 17:57:42 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:    
Bug Blocks: 1546627    

Description Anoop C S 2018-01-11 06:04:11 UTC
Description of problem:
The sole purpose of S10selinux-label-brick.sh hook script is to set required SELinux context on bricks after the volume is created. But the following error is seen during its execution:

/var/lib/glusterd/hooks/1/create/post/S10selinux-label-brick.sh: line 46: syntax error near unexpected token (' /var/lib/glusterd/hooks/1/create/post/S10selinux-label-brick.sh: line 46: semanage fcontext --add -t glusterd_brick_t -r s0 $b(/.*)?'

making it useless. Similar might be the case with S10selinux-del-fcontext.sh.

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

How reproducible:
Always

Steps to Reproduce:
1. Try executing the mentioned hook script independently after creating the volume.

Actual results:
Execution fails with error

Expected results:
Script must run successfully

Comment 1 Worker Ant 2018-01-11 06:06:55 UTC
REVIEW: https://review.gluster.org/19177 (extras/hooks: Fix S10selinux-label-brick.sh hook script) posted (#3) for review on master by Anoop C S

Comment 2 Anoop C S 2018-01-11 06:09:20 UTC
REVIEW: https://review.gluster.org/19177 (extras/hooks: Fix S10selinux-label-brick.sh hook script) posted (#3) for review on master by Milan Zink (zeten30)

Comment 3 Milan Zink 2018-01-12 10:02:48 UTC
Reviewed, looks good - https://review.gluster.org/19177

Comment 4 Atin Mukherjee 2018-01-14 15:05:33 UTC
Until and unless the patch is merged, please don't change the bug status :)

Comment 5 Worker Ant 2018-01-31 07:04:26 UTC
COMMIT: https://review.gluster.org/19177 committed in master by "Amar Tumballi" <amarts> with a commit message- extras/hooks: Fix S10selinux-label-brick.sh hook script

* script was failng due to syntax error
* shellcheck issues fixed
* improved performance: semanage & restorecon is being run on unique path

Change-Id: I58b357d9fd37586004a2a518f7a5d1c5c9ddd7e3
BUG: 1533342
Signed-off-by: Milan Zink <zeten30>

Comment 6 Worker Ant 2018-02-20 09:06:18 UTC
REVIEW: https://review.gluster.org/19600 (extras/hooks: Fix S10selinux-label-brick.sh hook script) posted (#1) for review on release-3.12 by jiffin tony Thottan

Comment 7 Worker Ant 2018-02-20 09:11:50 UTC
REVISION POSTED: https://review.gluster.org/19600 (extras/hooks: Fix S10selinux-label-brick.sh hook script) posted (#2) for review on release-3.12 by jiffin tony Thottan

Comment 8 Shyamsundar 2018-06-20 17:57:42 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-v4.1.0, please open a new bug report.

glusterfs-v4.1.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://lists.gluster.org/pipermail/announce/2018-June/000102.html
[2] https://www.gluster.org/pipermail/gluster-users/