Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
netmount fails during boot (dnsmasq issue ?)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
javeree
Apprentice
Apprentice


Joined: 29 Jan 2006
Posts: 285

PostPosted: Mon Oct 01, 2012 9:26 am    Post subject: netmount fails during boot (dnsmasq issue ?) Reply with quote

I have a PC that boots with the following results:
Quote:

* Starting acpid ...
[ ok ]
* Starting D-BUS system messagebus ...
[ ok ]
* Starting ConsoleKit daemon ...
[ ok ]
* Bringing up interface br0
* Creating bridge br0 ...
* 192.168.4.1 ...
[ ok ]
* Bringing up interface ethm
* Starting netplug on ethm ...
[ ok ]
* Backgrounding ...
* WARNING: net.ethm has started, but is inactive <= there's a cable attached. probably dhcp runs in the background ?
* Bringing up interface ethu
* Adding ports to br0
* ethu ...
[ ok ]
* Starting netplug on ethu ...
[ ok ]
* Backgrounding ...
* WARNING: net.ethu has started, but is inactive <== normal, there's no cable attached
* Starting rpcbind ... <= is it ok that this runs before dnsmasq ?
[ ok ]
* Starting NFS statd ... <= is it ok that this runs before dnsmasq ?
[ ok ]
* Starting dnsmasq ...
[ ok ] <= i would expect dnsmasq to be ready, but maybe ethm is still inactive ?
[ ok ]
* Setting up RPC pipefs ...
[ ok ]
* Starting idmapd ...
[ ok ]
* Starting avahi-daemon ...
[ ok ]
* Starting cupsd ...
[ ok ]
* Mounting nfsd filesystem in /proc ...
[ ok ]
* Exporting NFS directories ... <= dnsmasq should already be up and tell us the address of 'Venus'
exportfs: Failed to resolve Venus
exportfs: Failed to resolve Venus
exportfs: Failed to resolve Venus
[ ok ]
* Starting NFS mountd ...
[ ok ]
* Starting NFS daemon ...
[ ok ]
* Starting NFS smnotify ...
[ ok ]
* Mounting network filesystems ... <= dnsmasq should already be up and tell us the address of 'Venus'
mount.nfs: Failed to resolve server portage: Name or service not known
mount.nfs: Failed to resolve server portage: Name or service not known
mount.nfs: Failed to resolve server portage: Name or service not known
mount.nfs: Failed to resolve server Venus: Name or service not known
* Could not mount all network filesystems
[ !! ]


When I log in, rc-status tells me that service netmount is started, but my nfs mount points are not actually mounted.
If I do '/etc/init.d/netmount restart', all mounts are done properly.

Now this PC serves as a router with a local dnsmasq cache between 'ethm' (which gets its address through dhcp) and bridge br0, which contains a.o. ethu, and the nfs servers are upstream. That means (I assume) that nfs should query the local dnsmasq for the servers and get an answer from it. It seems like dnsmasq is not ready yet when it gets asked by nfsmount or nfsd.

How should I go about ensuring that dnsmasq is able to reply to name queries by nfsmount or nfsd while booting.
I've tried to make the service ordering as late as possible with the following in /etc/conf.d/netmount:
Code:

# make sure all network interfaces have been started
for SCRIPT in /etc/init.d/net.* ; do
        SERVICE="${SCRIPT##*/}"
        rc_after="$rc_after ${SERVICE}"
done
# make sure dnsmasq has been started
rc_after="$rc_after dnsmasq"


My guess is that the above code only delays netmount until after dnsmasq (the service) is being started, but not until dnsmasq (the process) is actually ready.
Another guess is that dnsmasq is ready, but the interface toward upstream is still waiting for dhcp info.

In any case, services needing name services should need to wait for something, but for what ?

Further info:
rc_depend_strict="no", because some interfaces are optional (a ppp1 interface and a usb wlan interface) and will not become active on each boot.
rc_parallel is not used.
Back to top
View user's profile Send private message
javeree
Apprentice
Apprentice


Joined: 29 Jan 2006
Posts: 285

PostPosted: Tue Oct 09, 2012 3:28 pm    Post subject: Reply with quote

After a bit of experimenting and thinking, I came to the conclusion that I really have a problem here that is not really solvable.
I see the problem because dhcp simply takes so long that ethm did not get an IP address yet at the time that nfdsd or netmount start.

On option would be to try to not start nfsd/netmount until ethm has started (this is in fact my previous question). However, there is nothing that guarantees that it will ever be started (e.g. the cable could be pulled), which would result in nfdsd never being available for all other interfaces.

Another option is to somehow have these services started as late as possible (any suggestions anyone?), but this will still never guarantee that I already have an address when the service starts.

The third option I see is to have the netplug script trigger a (re)start of the service. when the cable is connected.
Again this has as a disadvantage that I might be unmounting mounts that are already in use and cause trouble over the other interfaces.

I think the fional solution shall be that I write my own custom made services, where I have e.g. netmount.ethm, netmount.ethu, ...
with each of these only mounting when their respective interfaces comes up.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum