Bug 482826 - problems sourcing ifcfg-X file on ifup/ifdown
Summary: problems sourcing ifcfg-X file on ifup/ifdown
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-01-28 14:00 UTC by Jeff Layton
Modified: 2014-06-18 07:38 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-01-28 16:19:11 UTC
Type: ---
Embargoed:


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

Description Jeff Layton 2009-01-28 14:00:47 UTC
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 16:03:47 UTC
It's a bash change with bash 4.

Comment 3 Glauco Furlaneto 2010-02-28 15:21:43 UTC
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 18:47:49 UTC
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.