Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 53104 - net.eth0 brings down nfsroot interface - iface_stop() needs to check that $IFACE is not used by nfsroot
Summary: net.eth0 brings down nfsroot interface - iface_stop() needs to check that $IF...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Roy Marples (RETIRED)
URL:
Whiteboard:
Keywords:
: 75408 (view as bug list)
Depends on: 36624
Blocks: 66472
  Show dependency tree
 
Reported: 2004-06-05 20:33 UTC by Gregory P. Smith
Modified: 2005-05-27 09:03 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fixes is_net_fs to report the type $1 was mounted and not how it was mounted (is-net-fs.patch,679 bytes, patch)
2005-05-27 02:55 UTC, Roy Marples (RETIRED)
Details | Diff
fixes is_net_fs to report the type $1 was mounted and not how it was mounted (is-net-fs.patch,1.16 KB, patch)
2005-05-27 07:57 UTC, Roy Marples (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gregory P. Smith 2004-06-05 20:33:51 UTC
the /etc/init.d/net.eth0 script on system shutdown brings down eth0 happily even though the system was booted diskless using nfsroot.  needless to say the rest of the shutdown can't continue after the filesystem disappears.

i put a hack in my iface_stop() to just not allow bringing eth0 down.  a real solution would be to have it either check a config flag saying never to bring the interface down or check the current mounts and not bring it down if / is mounted via a network filesystem over than interface.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Aron Griffis (RETIRED) gentoo-dev 2004-06-26 14:19:42 UTC
Would you mind pasting the output of "cat /proc/mounts" here?  Then I'll be able to fix this problem
Comment 2 Gregory P. Smith 2004-06-27 15:43:07 UTC
here's my /proc/mounts output (2.4.2x based kernel):

greg@monster greg $ cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / nfs rw,v3,rsize=8192,wsize=8192,hard,posix,udp,nolock,addr=192.168.2.200 0 0
none /dev devfs rw 0 0
none /proc proc rw 0 0
none /proc/bus/usb usbdevfs rw 0 0
none /dev/shm tmpfs rw 0 0
none /tmp tmpfs rw 0 0
192.168.2.200:/home/nfsroot/usr /usr nfs rw,v3,rsize=8192,wsize=8192,acregmin=300,acregmax=300,acdirmin=300,acdirmax=300,hard,intr,posix,tcp,lock,addr=192.168.2.200 0 0
192.168.2.200:/home/nfsroot/home /home nfs rw,v3,rsize=8192,wsize=8192,acregmin=300,acregmax=300,acdirmin=300,acdirmax=300,hard,intr,posix,tcp,lock,addr=192.168.2.200 0 0

I don't know why it lists rootfs /  and /dev/root /.  clearly the latter indicates nfsroot.

(hmm unrelated side-note; interesting that it says 8k for rsize and wsize.  i have 32k in my fstab.  wonder if this kernel isn't patched for 32k r/wsize nfs)
Comment 3 MAL 2004-07-29 10:13:55 UTC
Could this help?

http://groups.google.com/groups?q=svc:+bad+direction&hl=en&lr=&ie=UTF-8&oe=UTF-8&scoring=d&selm=1rINI-3dU-23%40gated-at.bofh.it&rnum=1

From the few answers I have found out there, it does seem to be something to do with nfsd not liking some network traffic it's recieving.

I was told to add:

net.ipv4.ip_local_port_range = 49152 61000

to /etc/sysctl.conf

But it didn't help in my case.
Comment 4 MAL 2004-07-29 10:14:47 UTC
Ack, sorry.. wrong bug :/
Comment 5 Gregory P. Smith 2004-10-07 18:07:14 UTC
i just upgraded my kernel.  this still happens on a 2.6.8-gentoo-r7 kernel (without supermount; so its not supermount related)

I still use this to iface_stop() in /etc/init.d/net.eth0 as a hack workaround for now:

        # XXX GPS start hack gentoo bug #53104
        if [ "$IFACE" = "eth0" ]; then
            # XXX GPS this is a nfsroot system, don't allow the main iface to go down
            einfo "Not bringing ${IFACE} down, nfsroot needs it - gps"
            eend 0
            return 0
        fi
        # XXX GPS end hack
Comment 6 Aron Griffis (RETIRED) gentoo-dev 2004-10-24 21:39:39 UTC
should be fixed in baselayout-1.11.x

if you don't specify a predown() the default is now to check for NFS root and disallow downing any interfaces.
Comment 7 SpanKY gentoo-dev 2004-12-23 06:00:11 UTC
*** Bug 75408 has been marked as a duplicate of this bug. ***
Comment 8 Martin Hierling 2004-12-28 08:41:18 UTC
sorry to say but this issue is NOT fixed in baselayout-1.11.x

hotspareblade ~ # mount
19x.16x.11x.20x:/home/netboot/bladeS13 on / type nfs (rw,sync,hard,intr,nolock,rsize=8192,wsize=8192)
none on /dev type devfs (rw)
none on /proc type proc (rw)
none on /dev/shm type tmpfs (rw)

hotspareblade ~ # epm -q baselayout
baselayout-1.11.8

/sbin/functions.sh: line 376: /var/lib/init.d/serial-8487: Read-only file system
/sbin/functions.sh: line 383: /var/lib/init.d/serial-8487: No such file or directory
 * ERROR:  "/etc/init.d/serial" has syntax errors in it; not executing...
/sbin/functions.sh: line 376: /var/lib/init.d/sshd-8487: Read-only file system
/sbin/functions.sh: line 383: /var/lib/init.d/sshd-8487: No such file or directory
 * ERROR:  "/etc/init.d/sshd" has syntax errors in it; not executing...
/sbin/functions.sh: line 376: /var/lib/init.d/urandom-8487: Read-only file system
/sbin/functions.sh: line 383: /var/lib/init.d/urandom-8487: No such file or directory
 * ERROR:  "/etc/init.d/urandom" has syntax errors in it; not executing...
/sbin/rc: line 792: /var/lib/init.d/softlevel: Read-only file system
rm: cannot remove `/var/lib/init.d/failed': Read-only file system
rm: cannot remove `/var/lib/init.d/options'Power down.
: Read-only file system
rm: cannot remove `/var/lib/init.d/snapshot': Read-only file system
rm: cannot remove `/var/lib/init.d/softlevel': Read-only file system
rm: cannot remove `/var/lib/init.d/softscripts': Read-only file system
rm: cannot remove `/var/lib/init.d/softscripts.new': Read-only file system
rm: cannot remove `/var/lib/init.d/started': Read-only file system
 * Stopping devfsd ...                                                    [ ok ]
 * Deactivating swap ...                                                  [ ok ]
 * Unmounting filesystems ...                                             [ ok ]
 * Remounting remaining filesystems readonly ...                          [ ok ]

 * Fsck will be skipped on next startup
Comment 9 SpanKY gentoo-dev 2005-05-26 20:10:13 UTC
uberlord: confirm/check ?
Comment 10 Roy Marples (RETIRED) gentoo-dev 2005-05-27 02:55:07 UTC
Created attachment 59932 [details, diff]
fixes is_net_fs to report the type $1 was mounted and not how it was mounted

I think I have found the flaw - the /etc/fstab file may not contain a line to
indicate that / should be mounted nfs.

Please test the patch and report back
Comment 11 Roy Marples (RETIRED) gentoo-dev 2005-05-27 07:57:09 UTC
Created attachment 59952 [details, diff]
fixes is_net_fs to report the type $1 was mounted and not how it was mounted
Comment 12 Roy Marples (RETIRED) gentoo-dev 2005-05-27 09:03:06 UTC
baselayout-1.11.12-r4 is out with the patch

re-open if it still doesn't work