Bug 1533342 - Syntactical errors in hook scripts for managing SELinux context on bricks
Summary: Syntactical errors in hook scripts for managing SELinux context on bricks
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: scripts
Version: mainline
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Milan Zink
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1546627
TreeView+ depends on / blocked
 
Reported: 2018-01-11 06:04 UTC by Anoop C S
Modified: 2018-06-20 17:57 UTC (History)
2 users (show)

Fixed In Version: glusterfs-v4.1.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1546627 (view as bug list)
Environment:
Last Closed: 2018-06-20 17:57:42 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)

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@gmail.com)

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@redhat.com> 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@gmail.com>

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/


Note You need to log in before you can comment on or make changes to this bug.