Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 704653 - Misleading/wrong error message on cumin service start by unprivileged user.
Misleading/wrong error message on cumin service start by unprivileged user.
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: cumin (Show other bugs)
2.0
Unspecified Unspecified
low Severity low
: 2.0.1
: ---
Assigned To: Trevor McKay
Jan Sarenik
:
Depends On:
Blocks: 723887
  Show dependency treegraph
 
Reported: 2011-05-13 16:55 EDT by Trevor McKay
Modified: 2011-09-07 14:17 EDT (History)
3 users (show)

See Also:
Fixed In Version: cumin-0.1.4840-1
Doc Type: Bug Fix
Doc Text:
The cumin service init script must be run as the root user. However, the script lacked a check to ensure that it was run by the root user, with the result that running the script as an unprivileged user resulted in misleading error messages. With this update, the script fails immediately (and displays "[FAILED]") when it is run as an unprivileged user.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-09-07 14:17:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1249 normal SHIPPED_LIVE Moderate: Red Hat Enterprise MRG Grid 2.0 security, bug fix and enhancement update 2011-09-07 12:40:45 EDT

  None (edit)
Description Trevor McKay 2011-05-13 16:55:22 EDT
Description of problem:

Running "service cumin start" as an unprivileged user gives misleading error messages.  It complains that postgresql is not running, even if it is.  Find out exactly what is happening here, maybe find a better message.

4:38:26pm> eeyore:cumin/MRG-RHEL-6/cumin-0.1.4746 $ service cumin restart
Cumin's database server is not running
Run 'cumin-database start' as root
04:38:30pm> eeyore:cumin/MRG-RHEL-6/cumin-0.1.4746 $ sudo service cumin restart
Stopping cumin:                                            [  OK  ]
Starting cumin:
Comment 1 Trevor McKay 2011-05-23 13:14:01 EDT
After poking around, this is related to a general issue in RHEL 5, the SysVinit component.  Specificaly, the use of the "-c" option to pidof causes /sbin/service postgresql status to say that it's not running.

In the BZ below, the resolution seems to be to change init.d/functions so that it warns when privileges are required for a particular operation.  If that fix works, then in the particular cumin case the user should be warned that insufficient privilege exists to start cumin.

https://bugzilla.redhat.com/show_bug.cgi?id=684881
Comment 3 Trevor McKay 2011-05-25 10:34:14 EDT
Grabbed latest SysVinit package (SysVinit-2.86-17.el5), pidof -c has been fixed.

So, that particular issue will be repaired, however cumin checks for root user in cumin-database script used during startup, so the error messages are still misleading.  Fix coming....
Comment 4 Trevor McKay 2011-05-25 10:54:13 EDT
Fixed in revision 4786.
Comment 5 Trevor McKay 2011-05-25 11:00:25 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause:
  Scripts used during Cumin service start up must be run as the root user.  However, the root user check is missing in the Cumin SysVinit script.

Consequence:
  Attempting to start the cumin service as a non-root user gives misleading error messages, when the real problem is that the user is not root.

Fix:
  Add a root user check to the SysVinit script.  Mark the service start [FAILED] with an explanation if the user is not root.

Result:
  Non-root users will now be given accurate information on why the service start failed.
Comment 6 Trevor McKay 2011-05-25 11:22:43 EDT
For testing:

  Additional checks added to start case (includes start, restart, condrestart) and stop (if cumin was running).  These commands as a non-root user should FAIL with the the message "Must be root".

  Status should work as an unprivileged user as long as SysVinit-2.86-17.el5 or later is installed.
Comment 7 Jan Sarenik 2011-06-21 10:47:19 EDT
cumin-0.1.4840-1.el6.noarch

$ service cumin start
Starting cumin:                                            [FAILED]
Must be run as root
Comment 8 Douglas Silas 2011-08-08 10:31:02 EDT
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,11 +1 @@
-Cause:
+The cumin service init script must be run as the root user. However, the script lacked a check to ensure that it was run by the root user, with the result that running the script as an unprivileged user resulted in misleading error messages. With this update, the script fails immediately (and displays "[FAILED]") when it is run as an unprivileged user.-  Scripts used during Cumin service start up must be run as the root user.  However, the root user check is missing in the Cumin SysVinit script.
-
-Consequence:
-  Attempting to start the cumin service as a non-root user gives misleading error messages, when the real problem is that the user is not root.
-
-Fix:
-  Add a root user check to the SysVinit script.  Mark the service start [FAILED] with an explanation if the user is not root.
-
-Result:
-  Non-root users will now be given accurate information on why the service start failed.

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