Bug 132839

Summary: ifup dies horrid death if a ifcfg-eth* exists but device doesn't.
Product: [Fedora] Fedora Reporter: Valdis Kletnieks <valdis.kletnieks>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 7.82-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-09-17 20:40:41 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:
Attachments:
Description Flags
Patch to make ifup skip defined but nonexistent devices
none
better patch none

Description Valdis Kletnieks 2004-09-17 18:17:20 UTC
Description of problem:
ifup gets confused if you have an ifcfg-eth? script for a device that
isn't in the actual hardware configuration.  This is actually a
reasonable situation - I have ifcfg-eth3 and ifcfg-eth4 scripts for
two docking stations I often plug my laptop into.  The basic problem
is that in network-functions, the 'is_available' function gets
confused if it goes looking for a $HWADDR that doesn't exist, and we
end up calling 'rename_device eth3 eth0' or similar foolishness.

Version-Release number of selected component (if applicable):
initscripts-7.80-1

How reproducible:
Define some ifcfg-eth? for non-existent devices and set ONBOOT=YES
for them.

Steps to Reproduce:
1.
2.
3.
  
Actual results:
System hangs after several calls to rename_device with bad parameters.

Expected results:
Skip the interfaces that don't actually exist.

Additional info:
I've attached a patch against ifup and network-functions.

Comment 1 Valdis Kletnieks 2004-09-17 18:18:46 UTC
Created attachment 103960 [details]
Patch to make ifup skip defined but nonexistent devices

Comment 2 Valdis Kletnieks 2004-09-17 18:25:22 UTC
The fact that the system hangs after rename_device gets called several
times with bad parameters (invoking /sbin/nameif and creating several
'dev$RANDOM' interfaces) is a separate kernel bug I'll file once I
track the exact details down (possibly on the lkml and/or linux-netdev
lists, as I'm running a -mm kernel).

Comment 3 Bill Nottingham 2004-09-17 20:32:53 UTC
Surely you want -z, not -n?

Comment 4 Bill Nottingham 2004-09-17 20:40:08 UTC
Created attachment 103966 [details]
better patch

This is what's going into 7.82-1.

Comment 5 Valdis Kletnieks 2004-09-17 20:55:14 UTC
OK.. I can live with your patch,it fixes the problem too.. I'll
let somebody else decide whether or not we want the echo that
says "Device not found" (certainly makes it easier to debug if
you see the FAILED during system boot, as you have at least a
wild guess where to look)...

Comment 6 Bill Nottingham 2004-09-17 21:19:41 UTC
It should fall through to the:

echo $"$alias device ${DEVICE} does not seem to be present, delaying
initialization."

case. Unless there's no modprobe.conf entry, then it will fail silently.