# netmount stop doesn't stop nfsmount

## mieses

Updating net-fs/nfs-utils from 1.1.4-r1 to 1.2.3-r1 causes /etc/init.d/netmount to fail when mounting any NFS shares specified in /etc/fstab.

/etc/init.d/nfsmount and command line mount both continue to work. 

Running the netmount script manually does not produce any errors.

I have not tested netmount with other types of network shares, so I don't know if the problem is isolated to just NFS mounts or if netmount is completely broken.  Re-emerging baselayout-1.12.14-r1 did not help.

UPDATE: netmount stop and restart do not not stop nfsmount.  The NFS mounts are unmounted but the status of nfsmount remains "started".  From that point on, "netmount start" sees that nfsmount is already "started" and does not try to mount the (unmounted) NFS mounts.Last edited by mieses on Thu Mar 31, 2011 1:09 am; edited 2 times in total

----------

## richard.scott

make sure you have both NFS3 and NFS4 compiled "in" the kernel and also activate all flags for NFS-UTILS and re-compile it.

I had this with an error like 521 or something and I think this fixed it.

----------

## mieses

Thank you for the reply.  The settings were already set correctly.  

USE flags

```
net-fs/nfs-utils-1.2.3-r1  elibc_glibc ipv6 nfsv3 nfsv4 tcpd -caps -kerberos

```

Kernel options

```
# grep -i NFS /usr/src/linux/.config

CONFIG_NFS_FS=y

CONFIG_NFS_V3=y

CONFIG_NFS_V3_ACL=y

CONFIG_NFS_V4=y

# CONFIG_NFS_V4_1 is not set

# CONFIG_ROOT_NFS is not set

CONFIG_NFSD=m

CONFIG_NFSD_V2_ACL=y

CONFIG_NFSD_V3=y

CONFIG_NFSD_V3_ACL=y

CONFIG_NFSD_V4=y

CONFIG_NFS_ACL_SUPPORT=y

CONFIG_NFS_COMMON=y

CONFIG_NCPFS_NFS_NS=y
```

In case it has to do with RPC, here is the status of the related services:

```
# rc-status -a | grep -i rpc

 rpc.statd                            [ started  ]

 rpcbind                              [ started  ]

 rpc.idmapd                           [ stopped  ]

 rpc.pipefs                           [ started  ]
```

----------

## EatMeerkats

I recently had this problem as well, and after some searching, I figured out that I had to add "vers=3" to the mount options in /etc/fstab. Pretty annoying that there was no warning (that I saw, at least) in the emerge output about this!

----------

## mieses

After testing with the nfsvers=3 option in /etc/fstab,  I noticed that stopping netmount does not stop nfsmount!  I think this is the source of the problem. The presence of nfsvers=3 does not change the behavior.

"/etc/init.d/netmount start" does mount the NFS shares provided that nfsmount is not previously running.

"/etc/init.d/netmount stop" unmounts the NFS shares but does NOT stop nfsmount. Subsequent runs of "/etc/init.d/netmount start" do not try to mount the NFS shares because netmount sees that nfsmount is already running.

So the problem would not appear the first time netmount is run, only on any subsequent attempts to restart it.

----------

## richard.scott

AFAIK you need the kerberos flag for NFS to work if you don't tell it to use NFSV3 with the vers option.

Rich

----------

## Hu

Why are you running both netmount and nfsmount?  If you only want NFS, run only nfsmount and not netmount.

----------

## mieses

I don't want to use both netmount and nfsmount. I would like to only use netmount which has stopped mounting NFS shares since I updated net-fs/nfs-utils from 1.1.4-r1 to 1.2.3-r1.  I have since started testing nfsmount which led to some interesting(?) results:

When nfsmount is added to the default runlevel but is *stopped*, then "netmount start" will also start nfsmount and mount the shares, even though I did not explicitly call nfsmount. Looking through the netmount script, I see that it uses nfsmount, at least in some cases.

When nfsmount is deleted from all runlevels, then starting netmount does not start nfsmount and the NFS shares are not mounted. 

I'm still trying to understand the logic.

----------

## mieses

I added the kerberos USE flag to nfs-utils and re-emerged nfs-utils.  This also required the addition of the kerberos flag to net-libs/libtirpc and the emerging of 4 additional packages.  It didn't work. netmount still fails to mount NFS shares. I had no problems with netmount and the previous version of nfs-utils.

I tested with a single NFS mount specified in fstab. The server uses NFS3. The fstab mount options include nfsvers=3:

```
nfsserver mountpoint nfs nfsvers=3,defaults,user 0 0
```

There are some bug reports in bugzilla which might be related. Probably this version of nfs-utils was stabilized too soon.

----------

