ifup: network-functions: line 52: eth0: No such file or directory
This appeared twice every time I booted the machine.
I looked in /etc/sysconfig/network-script/network-functions, and line 52 was the (rather unhelpful):
. $CONFIG
I went through a prolonged debugging session, putting trace code in ifup and network-functions, and I found the problem was caused by line 155 of ifup:
is_available ${REALDEVICE}
REALDEVICE at this point is "eth0". is_available starts like this:
LC_ALL= LANG= ip -o link | grep -q $1
[ "$?" = "1" ] || return 0
alias=`modprobe -c | awk "/^(alias|install)[[:space:]]+$1[[:space:]]/ { print \\$3 }"`
if [ -z "$alias" -o "$alias" = "off" -o "$alias" = "/bin/true" ]; then
return 2
fi
modprobe $1 > /dev/null 2>&1 || return 1
# if it is a mainframe ccwgroup device, configure it before
# trying to rename it:
need_config ${1}
I haven't figured out what all the tests at the top do, but (for eth0 only, and only when rebooting) control comes through to the call to need_config. need_config looks like this:
CONFIG="ifcfg-${1}"
[ -f "${CONFIG}" ] && return
CONFIG="${1}"
[ -f "${CONFIG}" ] && return
local addr=`get_hwaddr ${1}`
if [ -n "$addr" ]; then
local nconfig=`get_config_by_hwaddr ${addr}`
if [ -n "$nconfig" ] ; then
CONFIG=$nconfig
[ -f "${CONFIG}" ] && return
fi
fi
So CONFIG gets changed from "ifcfg-moors" (which is what it was to start with) to "eth0" - and there is no such file (nor an ifcfg-eth0) in /etc/sysconfig/network-scripts.
I have "fixed" the problem by adding a line to the top of need_config:
[ -f "${CONFIG}" ] && return
but this is the ravings of someone who doesn't really know what is going on!
Helpful suggestions welcome.