Bug 199976 - "too many arguments" in High-Availability resource IPaddr2
Summary: "too many arguments" in High-Availability resource IPaddr2
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: bash
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-07-24 18:25 UTC by Troy C
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-07-25 09:09:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Troy C 2006-07-24 18:25:02 UTC
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 09:09:50 UTC
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.