# NFS Daemon refuses to start with post-2.6.13-mm sources

## aminalshmu

It's all in the title - 2.6.13-rcX-mmX work fine, but with 2.6.13-mm1 and mm2 I get this:

```
jordan@jordan jordan $ sudo /etc/init.d/nfs start

 * Mounting RPC pipefs ...                                                                   [ ok ]

 * Starting idmapd ...

rpc.idmapd: Skipping configuration file "/etc/idmapd.conf": No such file or directory        [ ok ]

 * Starting NFS statd ...                                                                    [ ok ]

 * Exporting NFS directories ...                                                             [ ok ]

 * Starting NFS daemon ...    

 * Error starting NFS daemon                                                                 [ !! ]

 * Starting NFS mountd ...                                                                   [ ok ]

```

the only thing i get in dmesg is this:

```
NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory

NFSD: starting 90-second grace period
```

which is the same whether i'm running a working kernel or not.

```
jordan@jordan linux $ cat .config | grep NFS

CONFIG_NFS_FS=y

CONFIG_NFS_V3=y

# CONFIG_NFS_V3_ACL is not set

CONFIG_NFS_V4=y

# CONFIG_NFS_DIRECTIO is not set

CONFIG_NFSD=y

CONFIG_NFSD_V3=y

# CONFIG_NFSD_V3_ACL is not set

CONFIG_NFSD_V4=y

CONFIG_NFSD_TCP=y

CONFIG_NFS_COMMON=y
```

any help on where to look for info on why this is happening... would be greatly appreciated. anyone else not having this problem with mm kernels?

----------

## speeding

Hi. 

This is just a "me too" post. Running the (kernel) NFSD server with 2.6.13-mm1 also does not work here.

The client seems to be fine. 

So far I tried "strace rpc.nfsd"  which shows it breaks while trying to write to "/proc/fs/nfs/threads" ( Gives a "permission denied" error, although the file comes up as "-rw" for root ). This also happens when I try "echo "8" > /proc/fs/nfs/threads".

In the log files I found the message "connect from unprivileged port" (or something like that  back to 2.6.12-mm2 for now), googling that only gives some old lkml posts form 2002/2003 with kernel 2.4.(18 /19 ) where the problem came up before.  That is where I got the "echo "8" ..." stuff form, as rpc.nfsd does not seem to do much else. 

I couldn't solve it so I'm back on kernel-2.6.12-mm2.

(edit my english is horrible, sorry!)

----------

## Shan

Yet anoter "me too"; this time running gentoo-sources-2.6.13

.config

```
nexus ~ # cat /usr/src/linux/.config | grep -i nfs

CONFIG_NFS_FS=y

CONFIG_NFS_V3=y

CONFIG_NFS_V3_ACL=y

CONFIG_NFS_V4=y

# CONFIG_NFS_DIRECTIO is not set

CONFIG_NFSD=y

CONFIG_NFSD_V2_ACL=y

CONFIG_NFSD_V3=y

CONFIG_NFSD_V3_ACL=y

CONFIG_NFSD_V4=y

CONFIG_NFSD_TCP=y

CONFIG_NFS_ACL_SUPPORT=y

CONFIG_NFS_COMMON=y

```

This shows that I have everything including nfsv4; except DirectIO enabled for NFS; and built in.

```
nexus ~ # cat /var/log/messages

Sep  8 14:54:14 nexus rpc.statd[13873]: Version 1.0.7 Starting

Sep  8 14:54:14 nexus nfsd[13883]: nfssvc: Function not implemented

Sep  8 14:54:14 nexus rc-scripts: Error starting NFS daemon

```

Applicable lines from my logs.

and this is what apparently starts when I try and run the service:

```
nexus ~ # ps -aux | grep -i rpc

rpc      12491  0.0  0.3   1736   648 ?        Ss   05:11   0:00 /sbin/portmap

nobody   13873  0.0  0.4   1672   776 ?        Ss   14:54   0:00 /sbin/rpc.statd

root     13889  0.0  0.3   1716   720 ?        Ss   14:54   0:00 /usr/sbin/rpc.mountd

```

From my googling and searching the forums, it seems as though the error reported in /var/log/messages about nfssvc not being implimented was signaling that the server daemon wasn't compiled with the kernel (either as a module or built in) but it seems as though that isn't the case with us.

SHAN EDIT: For snits and giggles I removed nfsv4 support from my servers kernel and recompiled and for some reason it works.  Seems as though this is only a nfsv4 issue.  Then again maybe its because I (we?) are trying to compile both nfsv3 and v4 server support in at once; but using make menuconfig with g-s atleast; doesn't allow me to just select v4.

----------

## speeding

Ok. I've tried compiling the kernel again. This time quite "basic":

- nfs compiled in

- no "direct IO" support 

- only version 3

```

CONFIG_NFS_FS=y

CONFIG_NFS_V3=y

# CONFIG_NFS_V3_ACL is not set

# CONFIG_NFS_V4 is not set

# CONFIG_NFS_DIRECTIO is not set

CONFIG_NFSD=y

CONFIG_NFSD_V3=y

# CONFIG_NFSD_V3_ACL is not set

# CONFIG_NFSD_V4 is not set

# CONFIG_NFSD_TCP is not set

CONFIG_NFS_COMMON=y

```

"/etc/init.d/nfs start" still breaks with these errors: 

```

[portmap] connect from 127.0.0.1 to set(nfs): request from unprivileged port

[nfsd] nfssvc: Permission denied

```

and strace gives:

```

strace rpc.nfsd:

(... lots of stuff ... )

open("/proc/fs/nfsd/threads", O_WRONLY) = 3

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

```

Trying 

```

echo "1" > /proc/fs/nfsd/threads

```

(thats what rpc.nfsd is basically trying to do...)

doesn't work either.

Emerging new nfs-utils also did not help.

Any more suggestions?

(edit: works with vanilla 2.6.13, so back to 2.6.12-mm2 for now)

----------

## ema

me too. strace gives this result:

```

<....lot of garbage...>

close(7)                                = -1 EBADF (Bad file descriptor)

close(6)                                = -1 EBADF (Bad file descriptor)

close(5)                                = -1 EBADF (Bad file descriptor)

close(4)                                = -1 EBADF (Bad file descriptor)

close(3)                                = 0

open("/proc/fs/nfsd/threads", O_WRONLY) = -1 ENOENT (No such file or directory)

open("/proc/fs/nfs/threads", O_WRONLY)  = 3

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

close(3)                                = 0

time([1126270044])                      = 1126270044

open("/etc/localtime", O_RDONLY)        = 3

fstat64(3, {st_mode=S_IFREG|0644, st_size=951, ...}) = 0

old_mmap(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7dc2000

read(3, "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0\0\0\6\0"..., 131072) = 951

close(3)                                = 0

munmap(0xb7dc2000, 131072)              = 0

getpid()                                = 26789

rt_sigaction(SIGPIPE, {0xb7ea1d80, [], 0}, {SIG_DFL}, 8) = 0

socket(PF_FILE, SOCK_DGRAM, 0)          = 3

fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0

connect(3, {sa_family=AF_FILE, path="/dev/log"}, 16) = 0

send(3, "<27>Sep  9 14:47:24 nfsd[26789]:"..., 58, 0) = 58

rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0

close(3)                                = 0

exit_group(1)                           = ?

```

any hints? i've tried to change permissions on /proc/fs/.... etc... but no results  :Sad: 

----------

## aminalshmu

anyone found out why this is happening yet? i want to test out 2.6.14-rc1-mm1 and i'm tired of 2.6.13-rc6-mm2.

i tried compiling without nfsv4, but no success.

is this a specific kernel problem and therefore distro independent, or something specific to gentoo?

----------

## JackDog

And me 

Here is a description of the problem:

http://lkml.org/lkml/2005/9/17/44

----------

## AdamWood

This is a Linux kernel problem. The port that the linux kernel uses for portmap has changed and it screws up some things. There's already a patch out for it. Released after the 2.6.14-rc2-mm1 sadly, so hopefully it will make it into the next release. Or whoever is making the mm-sources releases could be kind enough to include it in the ebuild. I have no idea who to talk to about this though.

I hope that helps anyone still having difficulties

Adam

----------

## shimbob

yet another me too most, but this time my nfsd is going apeshit with 2.6.14-rc2-mm2. 

I was also having problems with 2.6.13-whatever, hoped 2.6.14 was cured. guess not

----------

## augury

same w/ 2.6.14rc1mm1 (rc2 doesn't find sdb for my other mounts)

```

Oct 21 17:56:46 wren portmap[9493]: connect from 127.0.0.1 to set(nfs): request from unprivileged port

Oct 21 17:56:46 wren portmap[9494]: connect from 127.0.0.1 to unset(nfs)

Oct 21 17:56:46 wren portmap[9495]: connect from 127.0.0.1 to unset(nfs)

Oct 21 17:56:46 wren nfsd[9488]: nfssvc: Permission denied

Oct 21 17:56:46 wren rc-scripts: Error starting NFS daemon

Oct 21 17:56:46 wren portmap[9503]: connect from 127.0.0.1 to unset(mountd)

Oct 21 17:56:46 wren portmap[9504]: connect from 127.0.0.1 to set(mountd)

....

Oct 21 18:00:38 wren ypserv[10261]: WARNING: no securenets file found!

```

I think I butch'd my ypdomain too trying to fix it.  Just when I get a brand new laptop.

Thought I googled past something that said ports needed to be under 1024, which is ridiculous, says the ports unprivledged though.

----------

