Bug 801291 - cumin init script with exit code 0 for unknown parameter
cumin init script with exit code 0 for unknown parameter
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: cumin (Show other bugs)
Development
Unspecified Unspecified
low Severity unspecified
: 2.3
: ---
Assigned To: Trevor McKay
Peter Belanyi
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-08 03:08 EST by Stanislav Graf
Modified: 2014-11-17 21:24 EST (History)
7 users (show)

See Also:
Fixed In Version: cumin-0.1.5388-2
Doc Type: Bug Fix
Doc Text:
Cause The sysvinit script for Cumin returned a status code of 0 for unknown commands. Consequence Rather than indicate an error, the status code returned indicated success. Fix The status code is now set to 2 on an unknown command. Result The sysvinit script returns a non-zero error code when it is passed an unknown command. The value '2' is commonly used to indicate this condition.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-03-07 08:25:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stanislav Graf 2012-03-08 03:08:32 EST
Description of problem:

Cumin init script returns exit code '0' for unknown parameter. 

# service cumin dance
Usage: /etc/init.d/cumin {start|stop|status|restart|condrestart}
ecode=0

Other daemons returns '2'.

# service sshd dance
Usage: /etc/init.d/sshd {start|stop|restart|reload|force-reload|condrestart|try-restart|status}
ecode=2
# service ntpd dance
Usage: /etc/init.d/ntpd {start|stop|status|restart|try-restart|force-reload}
ecode=2


Version-Release number of selected component (if applicable):
cumin-0.1.5233-1.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. service cumin dance
2. echo $?

  
Actual results:
Cumin init script returns exit code '0' for unknown parameter

Expected results:
Cumin init script returns non-zero exit code for unknown parameter

Additional info:
Comment 1 Trevor McKay 2012-05-15 16:01:48 EDT
Fixed in revision 5378.
Comment 2 Trevor McKay 2012-05-15 16:05:30 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
    The sysvinit script for Cumin returned a status code of 0 for unknown commands.

Consequence
    Rather than indicate an error, the status code returned indicated success.

Fix
    The status code is now set to 2 on an unknown command.

Result
    The sysvinit script returns a non-zero error code when it is passed an unknown command.  The value '2' is commonly used to indicate this condition.
Comment 4 Trevor McKay 2012-10-03 11:58:08 EDT
Testing notes

Cumin will use '2' as the status code for unknown commands

# service cumin dance
Usage: /etc/init.d/cumin {start|stop|status|restart|condrestart}
# echo $?
2
Comment 7 Peter Belanyi 2013-01-15 08:20:46 EST
I was able to reproduce on cumin-0.1.5444-1

Verified on RHEL5 and RHEL6, both i386 and x86_64, with cumin-0.1.5648-1

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