Discussion:
can't activate eth0
Richard Reina
2010-04-03 12:41:15 UTC
Permalink
I am running Centos 5.4 on a few machines here. Yesterday I used /usr/sbin/setup to switch back from dhcp to a static IP on a private LAN. When I did a /etc/init.d/network restart I get:


fgrep: ifcfg-ifcfg-eth0: No such file or directory
fgrep: ifcfg-ifcfg-eth0: No such file or directory
/etc/init.d/network: line 247: ifcfg-ifcfg-eth0: No such file or directory
Shutting down loopback interface: [ OK ]
bringing up loopback interface [ OK ]
fgrep: ifcfg-ifcfg-eth0: No such file or directory
fgrep: ifcfg-ifcfg-eth0: No such file or directory
fgrep: ifcfg-ifcfg-eth0: No such file or directory
fgrep: ifcfg-ifcfg-eth0: No such file or directory
Bringing up interface ifcfg-eth0: ./ifup configuration for ifcfg-eth0 not found.

I have googled around but still have not been able to solve. Any help would be appreciated as it would likely save my Easter weekend with my family.

Thanks,

Richard
--
Linux Users Of Northern Illinois (Chicago) - Technical Discussion
http://luni.org/mailman/listinfo/luni
Tim Born
2010-04-03 13:54:46 UTC
Permalink
Richard -

I believe most of those msgs are coming from /etc/init.d/network.
The pattern fgrep is complaining about (ifcfg-ifcfg-eth0) looks odd. I
would expect something like ifcfg-eth0.
I believe it should be looking for file names of the network config
files in /etc/sysconfig/network-scripts.

Take a look at /etc/init.d/network around line 45. This should become a
interfaces=$(ls ifcfg* | \
LANG=C sed -e "$__sed_discard_ignored_files" \
-e '/\(ifcfg-lo\|:\|ifcfg-.*-range\)/d' \
-e '/ifcfg-[A-Za-z0-9\._-]\+$/ { s/^ifcfg-//g;s/[0-9]/
&/}' | \
LANG=C sort -k 1,1 -k 2n | \
LANG=C sed 's/ //')
Those errors are probably coming from about line 97. This is also where
# bring up all other interfaces configured to come up at boot time
for i in $interfaces; do
unset DEVICE TYPE SLAVE
eval $(LANG=C fgrep "DEVICE=" ifcfg-$i)
eval $(LANG=C fgrep "TYPE=" ifcfg-$i)
eval $(LANG=C fgrep "SLAVE=" ifcfg-$i)
Try adding an echo after the line where interaces gets set. On my
system I end up with this: 'interfaces=eth0'.
Hopefully that will point you a little closer to a solution.

best,
-tim
fgrep: ifcfg-ifcfg-eth0: No such file or directory
fgrep: ifcfg-ifcfg-eth0: No such file or directory
/etc/init.d/network: line 247: ifcfg-ifcfg-eth0: No such file or directory
Shutting down loopback interface: [ OK ]
bringing up loopback interface [ OK ]
fgrep: ifcfg-ifcfg-eth0: No such file or directory
fgrep: ifcfg-ifcfg-eth0: No such file or directory
fgrep: ifcfg-ifcfg-eth0: No such file or directory
fgrep: ifcfg-ifcfg-eth0: No such file or directory
Bringing up interface ifcfg-eth0: ./ifup configuration for ifcfg-eth0 not found.
I have googled around but still have not been able to solve. Any help would be appreciated as it would likely save my Easter weekend with my family.
Thanks,
Richard
--
"We act as though comfort and luxury were the chief requirements of life, when all that we need to make us happy is something to be enthusiastic about."
- Charles Kingsley
--
Linux Users Of Northern Illinois (Chicago) - Technical Discussion
http://luni.org/mailman/listinfo/luni
A***@wiwb.uscourts.gov
2010-04-03 20:34:01 UTC
Permalink
Post by Richard Reina
I am running Centos 5.4 on a few machines here. Yesterday I used
/usr/sbin/setup to switch back from dhcp to a static IP on a private LAN.
Post by Richard Reina
fgrep: ifcfg-ifcfg-eth0: No such file or directory
fgrep: ifcfg-ifcfg-eth0: No such file or directory
/etc/init.d/network: line 247: ifcfg-ifcfg-eth0: No such file or
directory
Post by Richard Reina
Shutting down loopback interface: [ OK ]
bringing up loopback interface [ OK ]
fgrep: ifcfg-ifcfg-eth0: No such file or directory
fgrep: ifcfg-ifcfg-eth0: No such file or directory
fgrep: ifcfg-ifcfg-eth0: No such file or directory
fgrep: ifcfg-ifcfg-eth0: No such file or directory
Bringing up interface ifcfg-eth0: ./ifup configuration for ifcfg-eth0
not found.

Okay, this may be obvious, but the script is being called w/ "ifcg-eth0"
instead of just "eth0" so it's not finding the config file to look
through. Here, in the /etc/sysconfig/network-scripts, running that ls|sed
mess [1]
$ ls ifcfg* | \
LANG=C sed -e "$__sed_discard_ignored_files" \
-e '/\(ifcfg-lo\|:\|ifcfg-.*-range\)/d' \
-e '/ifcfg-[A-Za-z0-9\._-]\+$/ { s/^ifcfg-//g;s/[0-9]/ &/}' | \
LANG=C sort -k 1,1 -k 2n | \
LANG=C sed 's/ //'

gets a list of network devices
eth0
eth1

from:
ifcfg-eth0
ifcfg-eth0:1
ifcfg-eth0:2
ifcfg-eth0:3
ifcfg-eth1
ifcfg-lo

so you may have a
ifcfg-ifcfg-eth0

file in there.

a

[1]
Redhat uses:
find all the interfaces besides loopback.
# ignore aliases, alternative configurations, and editor backup files
interfaces=`ls ifcfg* | LANG=C egrep -v
'(ifcfg-lo|:|-range|rpmsave|rpmorig|rpmnew)' | \
LANG=C egrep -v '(~|\.bak)$' | \
LANG=C egrep 'ifcfg-[A-Za-z0-9\._-]+$' | \
sed 's/^ifcfg-//g' |
sed 's/[0-9]/ &/' | LANG=C sort -k 1,1 -k 2n | sed 's/ //'`


----------------------
Andy Bach
Systems Mangler
Internet: ***@wiwb.uscourts.gov
Voice: (608) 261-5738;
Cell: (608) 658-1890

Any sufficiently advanced bug is indistinguishable
from a feature. -- Rich Kulawiec

Loading...