Bug 390271 - endless loop in ifdown-eth, OS freeze
endless loop in ifdown-eth, OS freeze
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: 2007-11-19 07:51 EST by Stas
Modified: 2014-03-16 23:11 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-26 13:39:52 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)
proposed patch to avoid endless loop (725 bytes, patch)
2007-11-19 07:51 EST, Stas
no flags Details | Diff
simpler patch (880 bytes, patch)
2007-11-21 11:38 EST, Bill Nottingham
no flags Details | Diff

  None (edit)
Description Stas 2007-11-19 07:51:16 EST
Description of problem:

ifdown-eth contains some code to deal with case when HWADDR is changed in
ifcfg-ethX to rename device on startup. If HWADDR change is detected, "ifdown
ethY" is executed to shut down corresponding device. But if we have 2 ethernet
devices eth0 and eth1 and swap HWADDRs in corresponding ifcfg-eth files, then
endless loop occurs:
- "ifdown eth0" calls "ifdown-eth eth0"
- ifdown-eth execs "ifdown eth1"
- "ifdown eth1" calls "ifdown-eth eth1"
- ifdown-eth execs "ifdown eth0"
- ...
No diagnostics is printed during this, so to end-user it looks like freeze.
Ctl-Alt-Del doesn't help.

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

Latest version of initscripts from CVS as of 18 Nov 2007 still has this code.

How reproducible:

Reliably.

Steps to Reproduce:
1. Use computer with 2 ethernet cards, both up.
2. Swap HWADDR values between ifcfg-eth0 and ifcfg-eth1
3. shutdown -r now
4. Look at console - OS freezes on network shutdown.
  
Actual results:

Freeze on shutdown.

Expected results:

Clean shutdown, syncing disks, halt or reboot depending on "shutdown" switch.

Additional info:

Patch attached.
Comment 1 Stas 2007-11-19 07:51:17 EST
Created attachment 263461 [details]
proposed patch to avoid endless loop
Comment 2 Stas 2007-11-21 05:35:23 EST
Steps to Reproduce on Fedora Core 8 Live CD:
1. Use computer with 2 ethernet cards, both up
2. Swap HWADDR values between ifcfg-eth0 and ifcfg-eth1
3. Run "/etc/init.d/network stop"
4. See how it never ends
Comment 3 Bill Nottingham 2007-11-21 11:38:08 EST
Created attachment 266091 [details]
simpler patch

Here's what I'm proposing - I'm trying to think of a case where you'd want to
continue when the device names don't match, and I can't think of one.
Comment 4 Stas 2007-11-22 09:55:51 EST
This patch works. And I agree, it's much better to bail out in case of
inconsistency instead of trying to guess which interface user was willing to
shut down.
Thank you.
Comment 5 Bill Nottingham 2007-11-26 13:39:52 EST
Added in CVS, will be in rawhide. May make a F8 update.
Comment 6 Stas 2007-11-27 09:27:02 EST
BTW, that backquote in the patch seems to break things. It's typo, I guess.
I didn't notice that before because I was applying your patch using cut-n-paste.
I don't even test it now when I see it because patch adds odd number of backquotes.
Comment 7 Bill Nottingham 2007-11-27 12:14:01 EST
Whoops, thanks.
Comment 8 Stas 2008-03-18 14:14:44 EDT
Now it hangs when MAC address is wrong (and NEWCONFIG is empty because of that,
and grep takes 1 argument and waits for input on stdin).
Comment 9 Stas 2008-03-18 15:07:23 EDT
It can be fixed merely by adding
[ -n "${NEWCONFIG}" ] &&
right before
eval $(LANG=C fgrep "DEVICE=" $NEWCONFIG)
Comment 10 Bill Nottingham 2008-03-18 16:36:27 EDT
Something similar added in git.
Comment 11 Magnus Glantz 2011-01-14 19:15:23 EST
*** Bug 669728 has been marked as a duplicate of this bug. ***

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