Bug 801291 - cumin init script with exit code 0 for unknown parameter
Summary: cumin init script with exit code 0 for unknown parameter
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: cumin
Version: Development
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: 2.3
: ---
Assignee: Trevor McKay
QA Contact: Peter Belanyi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-08 08:08 UTC by Stanislav Graf
Modified: 2014-11-18 02:24 UTC (History)
7 users (show)

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.
Clone Of:
Environment:
Last Closed: 2013-03-07 13:25:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 799242 0 low CLOSED sesame init.d script does not return error if /usr/bin/sesame is not executable 2021-02-22 00:41:40 UTC

Internal Links: 799242

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


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