Bug 801291

Summary: cumin init script with exit code 0 for unknown parameter
Product: Red Hat Enterprise MRG Reporter: Stanislav Graf <sgraf>
Component: cuminAssignee: Trevor McKay <tmckay>
Status: CLOSED CURRENTRELEASE QA Contact: Peter Belanyi <pbelanyi>
Severity: unspecified Docs Contact:
Priority: low    
Version: DevelopmentCC: athomas, esammons, ltoscano, matt, mkudlej, pbelanyi, tmckay
Target Milestone: 2.3   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 13:25:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stanislav Graf 2012-03-08 08:08:32 UTC
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 20:01:48 UTC
Fixed in revision 5378.

Comment 2 Trevor McKay 2012-05-15 20:05:30 UTC
    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 15:58:08 UTC
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 13:20:46 UTC
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