View previous topic :: View next topic |
Author |
Message |
AgBr Apprentice
Joined: 06 Nov 2010 Posts: 195
|
Posted: Wed Apr 10, 2013 8:57 am Post subject: nfs on notebooks |
|
|
Hi,
I am responsible for an environment with Gentoo-Desktops with nfs-mounted homes. Now I have to install some notebooks such that they are able to run autonomously with a guest-user if there is only a wlan connection and run like a common desktop with nfs-mounted homes if there is a lan connection up. Only in the latter case the box should attempt to mount the homes. As far as I understand udev should in some way do the trick. Unfortunately I am not familiar enough with udev to figure out how. Can anybody here give me a hint? |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Wed Apr 10, 2013 9:37 am Post subject: |
|
|
Openrc at work for that.
You just add your home mount after the net.eth0 (stupid new udev naming scheme, how should we speak about the first card now !) is loaded. The post-up step.
Search the forum for post-up example, or dig openrc manual. |
|
Back to top |
|
|
AgBr Apprentice
Joined: 06 Nov 2010 Posts: 195
|
Posted: Wed Apr 10, 2013 7:39 pm Post subject: |
|
|
krinn wrote: | Openrc at work for that.
You just add your home mount after the net.eth0 (stupid new udev naming scheme, how should we speak about the first card now !) is loaded. The post-up step.
Search the forum for post-up example, or dig openrc manual. |
Thanks for the hint. If I did understand the concept right something like this should work:
# /etc/fstab
nfs-server:/home /home nfs noauto,defaults 0 0
#/etc/conf.d/net
postup() {
if [ ${IFVAR} == 'eth0' ] ; then
mount /home
fi
}
postup is called whenever a network interface is brought up automatically. Right? |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Wed Apr 10, 2013 8:12 pm Post subject: |
|
|
right, so something you can get up by just plug-in the cable. See sys-apps/ifplugd working fine here.
edit: just to add, watch out with "eth0" interface name with udev-200, it has change, read the news for more info. With udev < 200 or other eth0 is fine. |
|
Back to top |
|
|
AgBr Apprentice
Joined: 06 Nov 2010 Posts: 195
|
Posted: Wed Apr 10, 2013 9:15 pm Post subject: |
|
|
krinn wrote: | right, so something you can get up by just plug-in the cable. See sys-apps/ifplugd working fine here.
edit: just to add, watch out with "eth0" interface name with udev-200, it has change, read the news for more info. With udev < 200 or other eth0 is fine. |
Empty 80-net-name-slot.rules is present here, so udev is respecting eth0. I will keep it this way as long it will work. |
|
Back to top |
|
|
|