Bug 482826 - problems sourcing ifcfg-X file on ifup/ifdown
problems sourcing ifcfg-X file on ifup/ifdown
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
rawhide
All Linux
low Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-28 09:00 EST by Jeff Layton
Modified: 2014-06-18 03:38 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-28 11:19:11 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch -- add explicit path to file we're trying to source in (466 bytes, patch)
2009-01-28 09:00 EST, Jeff Layton
no flags Details | Diff

  None (edit)
Description Jeff Layton 2009-01-28 09:00:47 EST
Created attachment 330227 [details]
patch -- add explicit path to file we're trying to source in

Looks like something has changed recently in the initscripts:

Bringing up loopback interface:  ./network-functions: line 80: .: ifcfg-lo: file not found
./network-functions: line 80: .: ifcfg-lo: file not found
Missing config file ifcfg-ifcfg-lo.
[  OK  ]
Bringing up interface eth0:  
Determining IP information for eth0... done.
./network-functions: line 80: .: ifcfg-eth0: file not found
./network-functions: line 80: .: ifcfg-eth0: file not found
Missing config file ifcfg-ifcfg-eth0.
[  OK  ]

The problem seems to be something with $PATH. We're trying to do this:

. $CONFIG

...but we need to actually do:

. ./$CONFIG

The attached patch fixed this for me.
Comment 1 Bill Nottingham 2009-01-28 11:03:47 EST
It's a bash change with bash 4.
Comment 3 Glauco Furlaneto 2010-02-28 10:21:43 EST
Thanks, but it is not all.

The definitive correction for this is:

In /etc/sysconfig/network-scripts/network-functions change lines:

Line 66:
From: PARENTCONFIG=`echo $CONFIG | sed 's/-[^-]*$//g'`
To: PARENTCONFIG="/etc/sysconfig/network-scripts/"

Line 67:
From: PARENTDEVNAME=${PARENTCONFIG##*/ifcfg-}
To: PARENTDEVNAME=${PARENTCONFIG##*/}

And the line 78 q(thanks Jeff Layton):
From: . $CONFIG
To: . ./$CONFIG

The warning/error messages do not display and the ifup/ifdown are still functioning properly.
Comment 4 Glauco Furlaneto 2010-02-28 13:47:49 EST
PS: This is the fix when installed bash 4 instead bash 3.

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