Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

nfsmount Doesn't Wait for net.wlan0 to Associate

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
10 posts • Page 1 of 1
Author
Message
John R. Graham
Administrator
Administrator
User avatar
Posts: 10905
Joined: Tue Mar 08, 2005 3:39 pm
Location: Somewhere over Winder, Georgia, USA

nfsmount Doesn't Wait for net.wlan0 to Associate

  • Quote

Post by John R. Graham » Tue Feb 05, 2013 5:02 pm

Actually, this happens with ntp-client service as well. These two services fail to complete properly, I believe, because, although the network interface has been started, wpa_supplicant hasn't yet associated to an access point when they try to start.

It doesn't seem to matter what I put in the rc_need in the appropriate /etc/conf.d/ file (or, at least, I haven't come up with the right answer). OpenRC appears to let the services try to start as soon as net.wlan0 has started. So, I end up without my NFS shares mounted and with my clock not most accurately set.

After I login, I can start those services (which show status "stopped") just fine and they always complete successfully. Of course, by then, the network is up and dhcpcd has gotten an IP address.

What am I doing wrong? As far as I know, this used to work but unfortunately I can't point to the change that made it stop working.

- John
I can confirm that I have received between 0 and 499 National Security Letters.
Top
John R. Graham
Administrator
Administrator
User avatar
Posts: 10905
Joined: Tue Mar 08, 2005 3:39 pm
Location: Somewhere over Winder, Georgia, USA

  • Quote

Post by John R. Graham » Fri Feb 08, 2013 3:13 pm

Polite bump.

- John
I can confirm that I have received between 0 and 499 National Security Letters.
Top
Ant P.
Watchman
Watchman
Posts: 6920
Joined: Sat Apr 18, 2009 7:18 pm
Contact:
Contact Ant P.
Website

  • Quote

Post by Ant P. » Fri Feb 08, 2013 7:09 pm

This might work, it makes dhcpcd wait in the foreground until it gets an IP:

Code: Select all

# /etc/conf.d/net
dhcpcd_wlan0="-w"
Top
John R. Graham
Administrator
Administrator
User avatar
Posts: 10905
Joined: Tue Mar 08, 2005 3:39 pm
Location: Somewhere over Winder, Georgia, USA

  • Quote

Post by John R. Graham » Fri Feb 15, 2013 3:01 am

Thanks. Alas, that didn't appear to do anything. I located the dhcpcd.conf option that did the same thing (waitip) and this did succeed in producing a very long timeout but didn't actually result in the nfsmount or ntp-client starting successfully. I'll report detailed logging shortly.

- John
I can confirm that I have received between 0 and 499 National Security Letters.
Top
Odward
n00b
n00b
Posts: 65
Joined: Wed Mar 21, 2012 6:30 am

  • Quote

Post by Odward » Fri Feb 15, 2013 8:05 am

I'd also be glad to know of a better solution, but I had the same problem with distcc failing to start because
the network wasn't ready. At the time I was using wicd, but I think the same thing could work for you.

My solution was to modify /etc/init.d/distccd

Code: Select all

start() {
         sleep 10
         ebegin "Starting distccd"
You can of course play with the necessary sleep time to suit your needs. I didn't actually test to see just how
small a sleep value I could get away with.

Also you may want to toy with the need / before / after type values to ensure that, for example, after
wpa_supplicant starts then ntp starts (with the sleep) then nfsmount can start (which won't need an additional
sleep since ntp already waited). Hopefully that makes sense, the goal being to prevent services requiring
the sleep for network to become ready from starting in a different order on a subsequent boot.

**Edit
I also realize this doesn't explain why / when it stopped working, and may not be an ideal solution :D
At the time I was personally using a static IP and had distcc configured to listen on that address, but I couldn't
figure out how else to make it wait for that address to become available for listening.
Top
John R. Graham
Administrator
Administrator
User avatar
Posts: 10905
Joined: Tue Mar 08, 2005 3:39 pm
Location: Somewhere over Winder, Georgia, USA

  • Quote

Post by John R. Graham » Fri Feb 15, 2013 1:39 pm

Thanks for the thought. Yeah, that occurred to me, too. Since all I have to do to correct the situation for now is run

Code: Select all

sudo rc default
I'm committed discovering the correct solution and living with the only slightly annoying workaround until I do.

- John
I can confirm that I have received between 0 and 499 National Security Letters.
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56264
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Fri Feb 15, 2013 10:15 pm

John R. Graham,

For your nfs shares, you can add bg to the mount options, that kicks the mount operation into the background and lets other things continue to start.
If you need the NFS shares for startup things, it may not be so good.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
krinn
Watchman
Watchman
User avatar
Posts: 7476
Joined: Fri May 02, 2003 6:14 am

  • Quote

Post by krinn » Fri Feb 15, 2013 10:25 pm

why not wait for your IP to get assign ?

Could add that after dhcp service, could add that as a service itself (says linkup) and make nfsmount depend on linkup

Code: Select all

ifconfig eth0 | grep 'inet' | cut -d: -f2 | awk '{ print $2 }'
Top
antonlacon
Apprentice
Apprentice
Posts: 257
Joined: Sun Jun 27, 2004 1:36 am

  • Quote

Post by antonlacon » Wed Apr 03, 2013 3:21 am

For ntp-client, editing /etc/init.d/ntp-client to 'need net' (instead of 'after net') in the depend() section made it properly wait for wlan0 to authenticate. Filed a bug on it here: https://bugs.gentoo.org/show_bug.cgi?id=463974
Top
javeree
Guru
Guru
Posts: 465
Joined: Sun Jan 29, 2006 5:17 pm

  • Quote

Post by javeree » Wed Apr 03, 2013 7:52 am

The problem with any approach is that requirements can vary wildly.
What if you have a PC with multiple network interfaces, of which only some are up depending on varying conditions ? Which interface shoud nfsmount wait for ?
I may have a number of mounts I need to access through eth0 and a number that I need through eth1, and a third one through wlan0. However, when wan0 does not come up for any reason, I still want the mounts for eth0 and eth1 to succeed.

A solution may be to mount as late as possible, but then (as someone pointed out), other services may need one of these mounts.

You may even want nfsmount without any net interface at all (e.g. I share portage over nfs. For consistency of setup all PC's, including the one sharing portage mount it on /mnt/portage. The sharing PC doesn't need net to mount portage).

I have also strugled in the past and finally found there is no single solution that works every time. I have read on the theory of systemd and think this is one point where systemd may have a solution.
My solution was to put rc_after statements in /etc/conf.d/nfsmount, and retry failed mounts in local.start
Top
Post Reply

10 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Authors
Gentoo is a trademark of the Gentoo Foundation, Inc. and of Förderverein Gentoo e.V.
The contents of this document, unless otherwise expressly stated, are licensed under the CC-BY-SA-4.0 license.
The Gentoo Name and Logo Usage Guidelines apply.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy