Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 299633

Summary: sys-apps/openrc: /etc/init.d/netmount hangs when network is not available
Product: Gentoo Linux Reporter: Fabio Erculiani (RETIRED) <lxnay>
Component: [OLD] baselayoutAssignee: Gentoo's Team for Core System packages <base-system>
Status: VERIFIED FIXED    
Severity: normal CC: roy, steev
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: sys-apps/openrc-0.5.3-r1 /etc/init.d/netmount patch
patch against source code (openrc-0.5.3)

Description Fabio Erculiani (RETIRED) gentoo-dev 2010-01-04 17:21:25 UTC
This happens in particular to Network Manager users. /etc/init.d/netmount is called too late and hangs at do_unmount while trying to umount network mounts.

The attached patch makes use of "umount -l" (lazy option) if "umount -at" doesn't work. I don't know anything about do_unmount so I thought it would be better to not touch it at all.

Reproducible: Always

Steps to Reproduce:
0. Use NetworkManager ;)
1. add some NFS shares into /etc/fstab
2. /etc/init.d/netmount start
3. shutdown your system
Comment 1 Fabio Erculiani (RETIRED) gentoo-dev 2010-01-04 17:22:35 UTC
Created attachment 215180 [details, diff]
sys-apps/openrc-0.5.3-r1 /etc/init.d/netmount patch
Comment 2 Fabio Erculiani (RETIRED) gentoo-dev 2010-01-04 17:28:52 UTC
Created attachment 215182 [details, diff]
patch against source code (openrc-0.5.3)
Comment 3 William Hubbs gentoo-dev 2010-01-04 17:54:43 UTC
Please write your patch against 0.6.0 and re-open and re-attach it to this bug.

Thanks much. :-)

William
Comment 4 Fabio Erculiani (RETIRED) gentoo-dev 2010-01-04 18:00:28 UTC
Hey William, the patch is the same, just committed openrc-0.6.0 to sabayon overlay.

http://gitweb.sabayon.org/?p=overlay.git;a=commit;h=953d9cf46a874024bbcd8c25fa545599c37fc0e3
Comment 5 William Hubbs gentoo-dev 2010-01-04 18:14:05 UTC
Roy,

what do you think about applying this?

Thanks,

William

Comment 6 Roy Marples 2010-01-05 08:56:24 UTC
Lazy umounting is Linux specific, so that needs to be taken into account.
Also, I've never gotten it to actually work when the network is down for my NFS shares.

Lastly, if NetworkManager stopping before netmount in the shutdown process then the dependencies for it are wrong. Does NetworkManager provide net?
Comment 7 Fabio Erculiani (RETIRED) gentoo-dev 2010-01-05 09:17:19 UTC
-l perfectly works with NFS mounts, and yes (sorry), it's Linux specific.

About the other question, from /etc/init.d/NetworkManager:
depend() {
   need hald
}

So no, it doesn't contain "provide net".
Comment 8 Roy Marples 2010-01-05 09:25:28 UTC
Well, that is the real error :)
Make it look like so

depend() {
   need hald
   provide net
}
Comment 9 Fabio Erculiani (RETIRED) gentoo-dev 2010-01-05 09:35:01 UTC
Does "provide net" work in baselayout-1 too? If steev acks, I can append "provide net" to NM init.d.

Anyway, the issue persists if, for some reason, network is not available and user is powering off.
Comment 10 Fabio Erculiani (RETIRED) gentoo-dev 2010-04-21 08:43:53 UTC
With latest openrc & baselayout, I'm not having this issue anymore.