Bug 177795 - nics automatically activated after unclean shutdown
Summary: nics automatically activated after unclean shutdown
Status: CLOSED DUPLICATE of bug 183706
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: initscripts (Show other bugs)
(Show other bugs)
Version: 4.0
Hardware: i386 Linux
Target Milestone: ---
: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
Depends On:
TreeView+ depends on / blocked
Reported: 2006-01-14 08:23 UTC by Dan Wong
Modified: 2014-03-17 02:57 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-05-02 17:05:33 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
make sure we're in a numeric runlevel before running ifup (378 bytes, patch)
2006-01-18 04:55 UTC, Bill Nottingham
no flags Details | Diff
dirty hack: check for rc.sysinit (347 bytes, patch)
2006-02-06 22:27 UTC, Bill Nottingham
no flags Details | Diff

Description Dan Wong 2006-01-14 08:23:55 UTC
Description of problem:

After unclean shutdown, nics automatically activated even though
nic interfaces have onboot=no set.

'service network restart' correctly deactivates/activates the respective nics. 
a manual reboot on the prompt also shows the correct behavior.

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

How reproducible:
all the time

Steps to Reproduce:
1. have multiple nics in system and configure some ifcfg files to have 
2. perform unclean shutdown by removing power cable from system
3. boot system back up
Actual results:
all nics activated

Expected results:
nics with onboot=no should not be active

Additional info:

Comment 1 Bill Nottingham 2006-01-16 18:52:12 UTC
What version of initscripts?

Comment 2 Dan Wong 2006-01-16 19:20:33 UTC

Comment 3 Bill Nottingham 2006-01-16 19:23:24 UTC
Also, what version of hotplug?

Comment 4 Dan Wong 2006-01-16 19:30:17 UTC

Comment 5 Bill Nottingham 2006-01-16 19:32:22 UTC
Hm, odd. This seems like a rehash of 157252 and 153669, which are fixed in those

What do your ifcfg files look like?

Comment 6 Dan Wong 2006-01-16 20:21:01 UTC
i actually experienced bug 153669 because I had El4 U1 installed at the time. 

Then I installed El4 U2 and saw that the manual reboot works correctly. 
However, when the system goes down uncleanly, the onboot=no is still not honored
when system comes back up.



I expect eth0 to not activate during boot.

Comment 7 Bill Nottingham 2006-01-16 20:24:53 UTC
Does /var/lock/subsys/network exist on these unclean boots?

Comment 8 Dan Wong 2006-01-16 21:02:11 UTC

Comment 9 Bill Nottingham 2006-01-16 21:06:48 UTC
OK, so the hotplug script sees that that exists, and therefore assumes the
network is up and tries to bring up the interface.

Of course, this all before the root FS is read/write, so we can't remove the
lock file.

Comment 10 Dan Wong 2006-01-16 21:56:49 UTC
You're right.
I removed the lock file and did an unclean reboot.
The respective interfaces are brought up/down correctly.

Any idea when this might get fixed?

Comment 11 Bill Nottingham 2006-01-16 21:58:59 UTC
Have to find a clean way to fix it.

Comment 12 Bill Nottingham 2006-01-18 04:55:06 UTC
Created attachment 123350 [details]
make sure we're in a numeric runlevel before running ifup

Does the attached patch fix it for you?

Comment 13 Dan Wong 2006-01-18 20:18:06 UTC
patch doesn't work.
I added debug messages to net.agent
and found that runlevel was already set to 3 before the runlevel comparison

Comment 14 Bill Nottingham 2006-01-18 20:22:14 UTC
Hm, if it happens because /var/lock/subsys/network is there, that means it's in
rc.sysinit. The runlevel should *not* be returning 3 there... except that the
old /var/run/utmp is there from the previous boot, and runlevel is reading that.

Back to the drawing board.

Comment 15 Dan Wong 2006-01-19 21:06:12 UTC
shouldn't the runlevel be cleared or reset at boot time

seems like we're uncovering problems of much wider scope

any service/operation that does a file lookup might get out of sync from an
unclean reboot depending on service/operation sequence

Comment 16 Bill Nottingham 2006-01-19 21:10:47 UTC
(In reply to comment #15)
> shouldn't the runlevel be cleared or reset at boot time

Sure, later in rc.sysinit. The hotplug events happen before that, before the
filesystem is even mounted read-write.

> any service/operation that does a file lookup might get out of sync from an
> unclean reboot depending on service/operation sequence

Nah, most everything else happens after rc.sysinit ends.

Comment 17 Bill Nottingham 2006-02-06 22:27:20 UTC
Created attachment 124289 [details]
dirty hack: check for rc.sysinit

Does this work better? It's a gross hack...

Comment 18 Dan Wong 2006-05-02 14:29:28 UTC
yes, it works.

can you formally release this fix?

Comment 19 Bill Nottingham 2006-05-02 17:05:33 UTC
Oops, sorry about that. Moving this to where it's being tracked for a RHEL update.

*** This bug has been marked as a duplicate of 183706 ***

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