Bug 199976 - "too many arguments" in High-Availability resource IPaddr2
"too many arguments" in High-Availability resource IPaddr2
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: bash (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-24 14:25 EDT by Troy C
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-25 05:09:50 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)

  None (edit)
Description Troy C 2006-07-24 14:25:02 EDT
Description of problem:
IPaddr2 heartbeat resource says "too many arguments" on line 277. 

Version-Release number of selected component (if applicable):
heartbeat-2.0.6

How reproducible:
add the IPaddr2 resource to /etc/ha.d/haresources, start heartbeat

Steps to Reproduce:
1. include IPaddr2::<virtual IP> to /etc/ha.d/haresources
2. /etc/init.d/heartbeat start
3. observe ;)
  
Actual results:
[root@sin ~]# /etc/init.d/heartbeat start
Starting High-Availability services:
/usr/lib/ocf/resource.d/heartbeat/IPaddr2: line 277: [: too many arguments
2006/07/24_13:04:16 INFO: IPaddr2 Resource is stopped
                                                           [  OK  ]
[root@sin ~]#

Expected results:
[root@sin ~]# /etc/init.d/heartbeat start
Starting High-Availability services:
2006/07/24_13:04:16 INFO: IPaddr2 Resource is stopped
                                                           [  OK  ]
[root@sin ~]#

Additional info:

changing line 277 from
        if [ $SYSTYPE = "Linux" -o $SYSTYPE = "SunOS" ]; then
to
         if [ x$SYSTYPE = x"Linux" -o x$SYSTYPE = x"SunOS" ]; then
appears to fix the problem.  Perhaps this is due to $SYSTYPE being assigned an
empty string, which [] doesn't recognize.
Comment 1 Tim Waugh 2006-07-25 05:09:50 EDT
The script you are running needs to be fixed; there is no bash bug here.

Either the fix you propose, or quoting the strings (like '[ "$SYSTYPE" = ...')
will fix the script.

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