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:
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
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....
Fixed in revision 4786.
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.
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.
cumin-0.1.4840-1.el6.noarch $ service cumin start Starting cumin: [FAILED] Must be run as root
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.