RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 823539 - init script failure for unprivileges / nonroot user
Summary: init script failure for unprivileges / nonroot user
Keywords:
Status: CLOSED DUPLICATE of bug 824297
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: tog-pegasus
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Vitezslav Crhonek
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-21 13:37 UTC by Petr Sklenar
Modified: 2012-05-29 11:43 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-29 11:43:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Petr Sklenar 2012-05-21 13:37:17 UTC
init script failure for unprivileges / nonroot user

Version-Release number of selected component (if applicable):
tog-pegasus-2.11.0-3.el6:

How reproducible:
deterministic 

Description of problem:
try to do any operations with non root:

tog-pegasus-2.11.0-3.el6
# su - superman -c "service tog-pegasus status; echo $?"
env: /etc/init.d/tog-pegasus: Permission denied
0
# su - superman -c "service tog-pegasus stop; echo $?"
env: /etc/init.d/tog-pegasus: Permission denied
0
# su - superman -c "service tog-pegasus start; echo $?"
env: /etc/init.d/tog-pegasus: Permission denied
0
# su - superman -c "service tog-pegasus I_dont_exists; echo $?"
env: /etc/init.d/tog-pegasus: Permission denied
0

  
Actual results:
return code 0

Expected results:
return code 4 during failure
could `service X status` say the status ?

Additional info:

Comment 2 RHEL Program Management 2012-05-25 03:45:54 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 3 Vitezslav Crhonek 2012-05-28 14:45:32 UTC
This bug is consequence of bz#824297. I suggest to close it as DUPLICATE.

Change init script mode bits to correct value with:
# chmod o+rx /etc/init.d/tog-pegasus

And then try to do operations as non root, everything should work correctly (even 'service X status' will say status).

Comment 4 Vitezslav Crhonek 2012-05-29 10:41:41 UTC
Also note, that reproducer is not correct, the "$?" is expanded before it is send tu "su -c" - it will be zero all the time:

# su - vcrhonek -c "false; echo $?"
0
# set -x
# su - vcrhonek -c "false; echo $?"
+ su - vcrhonek -c 'false; echo 0'
0

The reproducer should look like:
# su - vcrhonek -c 'false; echo $?'
+ su - vcrhonek -c 'false; echo $?'
1

Comment 5 Vitezslav Crhonek 2012-05-29 10:44:24 UTC
(In reply to comment #4)
> it will be zero all the time:

More precisely, it will be the exit status of the previous command.

Comment 6 Petr Sklenar 2012-05-29 11:00:00 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > it will be zero all the time:
> 
> More precisely, it will be the exit status of the previous command.
right you are, qa can not miss with \' and \"

Test looks OK:
http://pkgs.devel.redhat.com/cgit/tests/tog-pegasus/tree/Regression/bz326281-wrong-init-script-return-codes/runtest.sh


(In reply to comment #3)
> This bug is consequence of bz#824297. I suggest to close it as DUPLICATE.

yes, you can close as you wish.
Testing procedure in this bug is going to be performed in bug 824297

Comment 7 Vitezslav Crhonek 2012-05-29 11:43:00 UTC
OK, closing as a duplicate then. Thanks!

*** This bug has been marked as a duplicate of bug 824297 ***


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