Bug 596823
Summary: | syntax error in /etc/sysconfig/network-scripts/ifup-ib | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Karsten Weiss <knweiss> | ||||||
Component: | openib | Assignee: | Jay Fenlason <fenlason> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Network QE <network-qe> | ||||||
Severity: | low | Docs Contact: | |||||||
Priority: | high | ||||||||
Version: | 5.5 | CC: | balkov, bugzilla-redhat, christopher.dale, cww, dtian, grugnog, hjia, jeder, jfeeney, jumanjiman, mpoole, ogerlitz, qcai, roid, tao | ||||||
Target Milestone: | rc | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | |||||||||
: | 602941 (view as bug list) | Environment: | |||||||
Last Closed: | 2011-07-21 11:22:14 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: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 590060 | ||||||||
Attachments: |
|
I can confirm that this reproduces on 5.5 I see that this bug is still listed as 'New'. Is it ever going to be moved into the production build? *** Bug 670936 has been marked as a duplicate of this bug. *** *** Bug 673201 has been marked as a duplicate of this bug. *** ------- Comment From sudeeshjohn.com 2010-12-22 11:57 EDT------- I had communicated this issues to Doug Ledford (dledford), and he says that; "This patch is the same as how we modified this script for rhel6, so feel free to open a bug, but the patch is not really necessary (simplyreference the rhel6 rdma version of this script instead)" So RH can use the fixed version(ifup-ib script version2) of the script available, in RHEL6. Thanks.... Created attachment 487859 [details]
patch for openib-ifup-ib script
------- Comment From iranna.ankad.com 2011-05-26 06:50 EDT------- This is verified in RHEL5.7 Beta & confirmed its fixed...closing.. An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-1056.html |
Created attachment 417276 [details] Syntax error fix for /etc/sysconfig/network-scripts/ifup-ib from openib-1.4.1-5.el5 Description of problem: There is a syntax error in /etc/sysconfig/network-scripts/ifup-ib which causes the following boot process error message during Infiniband interface initialization: ifup-ib: line 79: [: too many arguments The problem is that bash's "-a" (AND) operator is not evaluated lazily i.e. the following construct in ifup-ib does not work correctly if the MTU variable is unset/empty: # cap the MTU where we should based upon mode if [ -n "${MTU}" -a $MTU -gt 2044 ]; then MTU=2044 fi This alternative works because the && operator is evaluated lazily: # cap the MTU where we should based upon mode if [ -n "${MTU}" ] && [ $MTU -gt 2044 ]; then MTU=2044 fi Another alternative would be this # cap the MTU where we should based upon mode if [ -n "${MTU}" ]; then if [ $MTU -gt 2044 ]; then MTU=2044 fi fi I've attached a patch which fixes the two occurrences of this construct in ifup-ib. Version-Release number of selected component (if applicable): # rpm -q openib openib-1.4.1-5.el5 How reproducible: Boot a system with an active IB interface which has not MTU configured explicitly in /etc/sysconfig/network-scripts/ifcfg-ib0. Steps to Reproduce: 1. Configure an ib0 interface without setting MTU in /etc/sysconfig/network-scripts/ifcfg-ib0 2. Boot the system 3. Watch for the error messages during ib0 interface initialization. Actual results: ifup-ib: line 79: [: too many arguments Expected results: No error message Additional info: Test cases: $ cat MTU-old.sh #!/bin/bash MTU="" if [ -n "${MTU}" -a $MTU -gt 2044 ]; then echo 1a else echo 1b fi MTU="2000" if [ -n "${MTU}" -a $MTU -gt 2044 ]; then echo 2a else echo 2b fi MTU="3000" if [ -n "${MTU}" -a $MTU -gt 2044 ]; then echo 3a else echo 3b fi $ cat MTU-new.sh #!/bin/bash MTU="" if [ -n "${MTU}" ] && [ $MTU -gt 2044 ]; then echo 1a else echo 1b fi MTU="2000" if [ -n "${MTU}" ] && [ $MTU -gt 2044 ]; then echo 2a else echo 2b fi MTU="3000" if [ -n "${MTU}" ] && [ $MTU -gt 2044 ]; then echo 3a else echo 3b fi Test results: $ ./MTU-old.sh ./MTU-old.sh: line 4: [: too many arguments 1b 2b 3a $ ./MTU-new.sh 1b 2b 3a