You are not logged in.

#1 2010-02-27 20:50:18

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

Having a few problems with NFS automounting...

Hello,

This is my fstab line:

192.168.1.10:/storage/public    /home/public    nfs    defaults,_netdev    0    0

I'm having a few problems with it. First off, it doesn't mount at boot, and I know exactly why though I do not know how to fix it. The reason is because I use NetworkManager, and from what I can tell, network connections are managed at the user level after I log in -- thus there is no network connection at boot, and thus NFS cannot mount.

I'm not really sure how to fix this. I'm on a Desktop PC, so I'm always connected via Ethernet. However, my Mobo also has a wireless card built into it (of which I use sometimes for various random things). Thus, I opted to use NetworkManager to manage my connections, since it has nice integration with KDE4 and I can tell it when to use the wireless and when not to. But I also have a laptop which connects ONLY through wireless, so it's probably an even bigger problem automouting the share on the laptop.

On the desktop, is there anyway to have the NetworkManager activate eth0 at boot and activate wlan0 in userspace? And for the laptop, is there anyway to have the NFS share automount when my laptop makes a connection to my home network? Or can somebody recommend a better way to do this (perferably one that has a nice KDE GUI. =P).

That's problem #1. Problem #2 is when it does mount. After I manually mount it, it hangs at shut down, during the "Unmounting Network Filesystems". The culprit is /etc/rc.d/netfs. It trys to unmount the NFS mount, but it can't for some reason. I'm not really sure why. Any ideas on how to fix this?

Here is my DAEMONS entry:

DAEMONS=(syslog-ng !network nfs-common netfs cups dbus hal networkmanager mysqld crond alsa kdm)

`network` is not initialized because I'm using `networkmanager`, and the wiki says to disable it. smile

I can provide more info or explanation if need be. smile

Thanks!

Last edited by XtrmGmr99 (2010-02-27 20:57:35)

Offline

#2 2010-02-27 21:41:30

earthpig
Member
Registered: 2009-03-24
Posts: 30

Re: Having a few problems with NFS automounting...

XtrmGmr99 wrote:

Hello,
I'm having a few problems with it. First off, it doesn't mount at boot, and I know exactly why though I do not know how to fix it. The reason is because I use NetworkManager, and from what I can tell, network connections are managed at the user level after I log in -- thus there is no network connection at boot, and thus NFS cannot mount.

I'm not really sure how to fix this. I'm on a Desktop PC, so I'm always connected via Ethernet.

im not so sure that is the case. i have a system connected via ethernet, and i am able to ssh into it while it is at the gdm screen, before anyone has logged in. what you say is true of wireless connections, however.

maybe you would be better off leaving that line off of your fstab, and creating your own daemon and putting it in /etc/rc.d, and then adding it to the daemons in rc.conf?

i've never tried this, but most of the daemons in rc.d are just bash scripts so it looks like it would work.

you could edit an existing daemon script so it starts and stops when you boot/shut down...

#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

PID=`pidof -o %PPID /usr/sbin/cupsd`
case "$1" in
  start)
    stat_busy "Starting CUPS Daemon"
    [ -z "$PID" ] && /usr/sbin/cupsd
    if [ $? -gt 0 ]; then
      stat_fail
    else
      echo $(pidof -o %PPID -x /usr/sbin/cupsd) > /var/run/cups.pid
      add_daemon cups
      stat_done
    fi
    ;;
  stop)
    stat_busy "Stopping CUPS Daemon"
    [ ! -z "$PID" ]  && kill $PID &> /dev/null
    if [ $? -gt 0 ]; then
      stat_fail
    else
      rm /var/run/cups.pid
      rm_daemon cups
      stat_done
    fi
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"  
esac
exit 0

/usr/sbin/xfs_metadump looks like it's just a bash script... so you could have your daemon (bash script) point to a bash script in /usr/share/bin or wherever you feel like putting it.

Last edited by earthpig (2010-02-27 21:49:48)

Offline

#3 2010-02-27 23:10:10

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: Having a few problems with NFS automounting...

I have the same problem. I just 'sudo /etc/rc.d/netfs start' if I need to mount it. I know that's not very convenient but I don't know of another way.
I used to use netcfg for my wireless connection and I had that start in the DAEMONS() array before netfs. That works but netcfg can take a little while to connect to the wireless so that makes boot time slower. Now I use wicd and don't have a choice about it.


neutral

Offline

#4 2010-02-28 00:04:44

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Having a few problems with NFS automounting...

I use netcfg, and to make sure the network is up before the shares are mounted, I run /etc/rc.d/netfs from POST_UP in my netcfg profile. I haven't used either networkmanager or wicd, but maybe they can do something like that too i.e. run user-specified commands after the net connection has been established.

Offline

#5 2010-03-04 04:40:06

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

Re: Having a few problems with NFS automounting...

earthpig wrote:
XtrmGmr99 wrote:

Hello,
I'm having a few problems with it. First off, it doesn't mount at boot, and I know exactly why though I do not know how to fix it. The reason is because I use NetworkManager, and from what I can tell, network connections are managed at the user level after I log in -- thus there is no network connection at boot, and thus NFS cannot mount.

I'm not really sure how to fix this. I'm on a Desktop PC, so I'm always connected via Ethernet.

im not so sure that is the case. i have a system connected via ethernet, and i am able to ssh into it while it is at the gdm screen, before anyone has logged in. what you say is true of wireless connections, however.

Hmm, it seem's you're right. I connect automatically via Ethernet.

However, that doesn't explain why it fails to mount eh NFS share. I saw that i had networkmanager start after netfs, and I've corrected that in my rc.conf:

DAEMONS=(syslog-ng !network dbus hal networkmanager nfs-common netfs @cups @mysqld crond alsa kdm)

NetworkManager starts before netfs, thus it should create a link and NFS should be able to connect, but it doesn't. I have to manually mount it via `mount -a`.

I'm still also stuck with the shutdown hang it causes when I do mount it. I don't know what to do about that.

Creating my own daemon is an option, but I'd rather use it as a last resort. I'd like to find out why it's not doing what it should be doing first. smile

tomk wrote:

I use netcfg, and to make sure the network is up before the shares are mounted, I run /etc/rc.d/netfs from POST_UP in my netcfg profile. I haven't used either networkmanager or wicd, but maybe they can do something like that too i.e. run user-specified commands after the net connection has been established.

I think I remember reading something about that on the Wiki; I'll have a look. smile

Offline

Board footer

Powered by FluxBB