This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 846040 - Gluster init scripts are returning 1 when run by non root user, expect return is 4.
Gluster init scripts are returning 1 when run by non root user, expect return...
Status: CLOSED WONTFIX
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: gluster-swift (Show other bugs)
2.0
All Linux
low Severity low
: ---
: ---
Assigned To: Vivek Agarwal
SATHEESARAN
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-06 11:52 EDT by Ben Turner
Modified: 2016-02-17 19:02 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-02-23 02:03:07 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch for gluster-swift-account (649 bytes, patch)
2012-08-06 11:52 EDT, Ben Turner
no flags Details | Diff

  None (edit)
Description Ben Turner 2012-08-06 11:52:26 EDT
Created attachment 602538 [details]
patch for gluster-swift-account

Description of problem:  The following gluster init scripts give the wrong return code when executed by non root users:

gluster-swift-account	
gluster-swift-container	
gluster-swift-object	
gluster-swift-proxy	
gluster-system-settings	
glusterd       	

Based on:

http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

I would expect to see a return code of 4.  We are currently returning 1.


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


How reproducible:

Every time.

Steps to Reproduce:
1. Run su testuserqa -c 'service gluster-swift-proxy start'; echo $?
2.
3.
  
Actual results:

# su testuserqa -c 'service gluster-swift-account start'; echo $?
/usr/share/gluster-swift/functions: line 35: ulimit: open files: cannot modify limit: Operation not permitted
Starting swift-proxy-server: /bin/bash: /var/run/swift/proxy-server.pid: Permission denied
/bin/bash: /var/log/swift-startup.log: Permission denied
                                                           [FAILED]
1

Expected results:

# su testuserqa -c 'service gluster-swift-account start'; echo $?
4

Additional info:

I attached a patch for gluster-swift-account that resolves this issue.  This method should work for all of the init scripts I mentioned above.
Comment 1 Ben Turner 2012-08-06 11:53:58 EDT
Here are the package versions:

glusterfs-geo-replication-3.3.0rhs-25.el6rhs.x86_64
vdsm-gluster-4.9.6-14.el6rhs.noarch
gluster-swift-plugin-1.0-5.noarch
gluster-swift-container-1.4.8-4.el6.noarch
org.apache.hadoop.fs.glusterfs-glusterfs-0.20.2_0.2-1.noarch
glusterfs-fuse-3.3.0rhs-25.el6rhs.x86_64
glusterfs-devel-3.3.0rhs-25.el6rhs.x86_64
glusterfs-rdma-3.3.0rhs-25.el6rhs.x86_64
gluster-swift-proxy-1.4.8-4.el6.noarch
gluster-swift-account-1.4.8-4.el6.noarch
gluster-swift-doc-1.4.8-4.el6.noarch
glusterfs-3.3.0rhs-25.el6rhs.x86_64
glusterfs-server-3.3.0rhs-25.el6rhs.x86_64
gluster-swift-1.4.8-4.el6.noarch
gluster-swift-object-1.4.8-4.el6.noarch
Comment 2 Niels de Vos 2012-10-31 07:28:56 EDT
From http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

In case of an error while processing any init-script action except for status, the init script shall print an error message and exit with a non-zero status code:

1	generic or unspecified error (current practice)
2	invalid or excess argument(s)
3	unimplemented feature (for example, "reload")
4	user had insufficient privilege
5	program is not installed
6	program is not configured
7	program is not running


-> returning 4 is the correct behaviour when the user (here testuserqa) does not have enough privileges.
Comment 3 Prashanth Pai 2015-02-23 02:03:07 EST
Change cannot be made against gluster-swift to fix this, has to be made in Openstack Swift.

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