# Mouting NFS at boot time w/NetworkManager

## Evilguru

I have been using NetworkManager (which runs at start-up) along with an entry in /etc/fstab:

```

server:/srv/shared      /home/freddie/Shared     nfs     auto,bg

```

in order to have my shares mounted automatically (by nfsmount).  However, a couple of days ago, after an update to NetworkManager, this stopped working.  In /var/log/messages I see:

```

Mar 25 09:08:44 localhost /etc/init.d/nfsmount[19147]: WARNING: nfsmount is scheduled to start when NetworkManager has started

```

and hence am wondering if I am doing something wrong here?

Regards, Freddie.

----------

## DONAHUE

that is supposed to be just an info message, the question would be: Does nfsmount start, without you starting it, in the next minute or two?

----------

## Evilguru

 *DONAHUE wrote:*   

> that is supposed to be just an info message, the question would be: Does nfsmount start, without you starting it, in the next minute or two?

 

No.  I am forced to run /etc/init.d/nfsmount restart after logging in for the share to be mounted.  I have waited in excess of 10 minutes in the past, to no avail.  Seems as if it is giving up rather than trying to background mount.

Regards, Freddie.

----------

## DONAHUE

rc_parallel="NO" in /etc/rc.conf might help

----------

## Evilguru

 *DONAHUE wrote:*   

> rc_parallel="NO" in /etc/rc.conf might help

 

RC parallel is indeed disabled.

Regards, Freddie.

----------

## fredbear5150

I myself had the same problem and have "rc_parallel=YES" on all my machines. I also use NetworkManager.

The strange thing is that the same two NFS shares I use mount okay on boot on two other machines but not on one of them - maybe it's something to do with the time it takes for the network interface to come up.

Anyway, I fixed it by adding two scripts in /etc/NetworkManager/dispatcher.d:

```
55-rpcbind:

#!/bin/bash

/etc/init.d/rocbind status | grep -q "started"

if test "$2" == "up" -a "$?" != "0" ; then

        rc-config start rpcbind 

else

        rc-config stop rpcbind

fi

```

and:

```
60-nfsmount:

#!/bin/bash

/etc/init.d/nfsmount status | grep -q "started"

if test "$2" == "up" -a "$?" != "0" ; then

        rc-config start nfsmount

else    

        rc-config stop nfsmount

fi

```

You will need to make them executable and then remove nfsmount and rpcbind from rc-update to let the NetworkManager dispatcher start these two services after the network interface has come up.

----------

## orzel

 *fredbear5150 wrote:*   

> You will need to make them executable and then remove nfsmount and rpcbind from rc-update to let the NetworkManager dispatcher start these two services after the network interface has come up.

 

I had the problem here, at every boot. I could clearly see from my dhcp server log that nfsmount is started before the network is up.

This tip fixed it, thanks a lot !

----------

## pgu

I have the same problem. nfsmount does not seem to start at boot, even after rc-update add nfsmount default. However, running /etc/init.d/nfsmount restart after I have booted will mount the filesystems. Seems like there is a missing dependency in nfsmount so that it's started after the required networking resources has loaded.

EDIT: BTW I'm not using the network manager

----------

