Bug 1546627 - 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: 3.12
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jiffin
QA Contact:
URL:
Whiteboard:
Depends On: 1533342
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-19 04:56 UTC by Jiffin
Modified: 2018-04-24 06:53 UTC (History)
4 users (show)

Fixed In Version: glusterfs-3.12.8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1533342
Environment:
Last Closed: 2018-04-24 06:53:38 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Jiffin 2018-02-19 04:56:27 UTC
+++ This bug was initially created as a clone of Bug #1533342 +++

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

--- Additional comment from Worker Ant on 2018-01-11 01:06:55 EST ---

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

--- Additional comment from Anoop C S on 2018-01-11 01:09:20 EST ---

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)

--- Additional comment from Milan Zink on 2018-01-12 05:02:48 EST ---

Reviewed, looks good - https://review.gluster.org/19177

--- Additional comment from Atin Mukherjee on 2018-01-14 10:05:33 EST ---

Until and unless the patch is merged, please don't change the bug status :)

--- Additional comment from Worker Ant on 2018-01-31 02:04:26 EST ---

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 1 Worker Ant 2018-02-20 09:11:53 UTC
REVIEW: 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 2 Worker Ant 2018-04-06 12:48:22 UTC
COMMIT: https://review.gluster.org/19600 committed in release-3.12 by "jiffin tony Thottan" <jthottan> 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

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

Change-Id: I58b357d9fd37586004a2a518f7a5d1c5c9ddd7e3
BUG: 1546627
Signed-off-by: Jiffin Tony Thottan <jthottan>

Comment 3 Jiffin 2018-04-24 06:53:38 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-3.12.8, please open a new bug report.

glusterfs-3.12.8 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/gluster-devel/2018-April/054749.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.