# NFS - startup problem.

## coRpTitan

Hello,

I'm trying to set-up server for diskless clients, I'm following this tutorial: http://www.gentoo.org/doc/en/diskless-howto.xml .

Everything goes fine, but I'm stuck at step, where I'm supposed to install and run NFS service.

I did exactly according to HowTo, unfortunately I'm not able to run that service. This is what I got, when trying to start it:

```
# /etc/init.d/nfs start

Authenticating root.

Password:

 * Exporting NFS directories ...                                                                                                                                           [ ok ]

 * Starting NFS mountd ...                                                                                                                                                 [ ok ]

 * Starting NFS daemon ...

rpc.nfsd: Setting version failed: errno 16 (Device or resource busy)

rpc.nfsd: writing fd to kernel failed: errno 13 (Permission denied)

rpc.nfsd: unable to set any sockets for nfsd                                                                                                                               [ !! ]

 * Starting NFS smnotify ...                                                                                                                                               [ ok ]

 * ERROR: nfs failed to start

#
```

When I checked init.d script I found out it's trying to run it by using following: /usr/sbin/rpc.nfsd 8 .

When I tried to run it directly from bash via strace, to see where it's getting access denied, then I found out following:

```

open("/proc/fs/nfsd/versions", O_WRONLY|O_LARGEFILE) = 3

write(3, "+2 +3 +4 \n", 10)             = -1 EBUSY (Device or resource busy)

write(2, "rpc.nfsd: ", 10rpc.nfsd: )              = 10

write(2, "Setting version failed: errno 16"..., 58Setting version failed: errno 16 (Device or resource busy)) = 58

write(2, "\n", 1

)                       = 1

close(3)                                = 0

...

...

...

open("/proc/fs/nfsd/portlist", O_WRONLY|O_LARGEFILE) = 3

write(3, "4\n", 2)                      = -1 EACCES (Permission denied)

write(2, "rpc.nfsd: ", 10rpc.nfsd: )              = 10

write(2, "writing fd to kernel failed: err"..., 57writing fd to kernel failed: errno 13 (Permission denied)) = 57

write(2, "\n", 1

)                       = 1

close(3)                                = 0

```

So now it's clear that for some reason it can't write data into /proc/fs/nfsd/versions & /proc/fs/nfsd/portlist .

I'm SeLinux user, but my SeLinux is in "SELINUX=permissive" so it should not be blocked by SeLinux.

My TIP is that I forgot to enable some option in kernel, but I can't figure out which one :(

Thank you for any hints.

----------

## Rexilion

It seems to want to 'write' it's version? Did you check you enabled the correct nfs options? (v3 vs v4?)

----------

## coRpTitan

 *Rexilion wrote:*   

> It seems to want to 'write' it's version? Did you check you enabled the correct nfs options? (v3 vs v4?)

 

Sorry for long delay,

In kernel I don't have compiled support of NFSv4, and nfs-utils I have in last version, installed from portage with following: 

USE="-nfsv4" emerge -av net-fs/nfs-utils

So it's also without NFSv4 support, only version 3 is enabled.

But I would say It should be able to write into that files, but can't for some reason, even when it's mounted with rw option:

```
# mount | grep nfsd

nfsd on /proc/fs/nfsd type nfsd (rw,noexec,nosuid,nodev)

#
```

----------

## cerise

 *coRpTitan wrote:*   

> 
> 
> But I would say It should be able to write into that files, but can't for some reason, even when it's mounted with rw option:

 

The reason it fails is from the kernel, but I haven't been able to figure out why it happens just yet.  It has nothing to do (apparently) with any kernel options or SELinux.

----------

