# error starting NFS statd

## rmoerlan

When I try to start NFS I get the following:

```
* Error starting NFS statd                                                                                      [ !! ]
```

Looking at /var/log/messages it appears there is a permissions problem:

```
rpc.statd[17731]: open (/var/lib/nfs/state): Permission denied

rc-scripts: Error starting NFS statd
```

I've screwed around with the permissions on /var/lib/nfs/state to no avail.  

```
-rw-r-xr-x   1 nobody root    0 Aug 18 15:10 state
```

I've done a lot of searching the documentation, these forums, usenet, and the web and can't seem to find an answer that resolves the problem.

Thoughts?

Thanks!

----------

## xbmodder

Can benji20 be banned now? Also in other news. 

try  chmod 777?

----------

## rmoerlan

```
-rwxrwxrwx   1 nobody root    0 Aug 18 15:10 state
```

results in:

```
rpc.statd[19118]: Version 1.0.7 Starting

rpc.statd[19118]: open (/var/lib/nfs/state): Permission denied

rc-scripts: Error starting NFS statd

```

I don't get it.  rpc.statd should be running with sufficient permissions to modify the state file, right?  

BTW, the reason I'm running nfs-utils 1.0.7 is 1.0.6-r6 didn't work either.  :Sad: 

----------

## zeek

 *rmoerlan wrote:*   

> 
> 
> ```
> -rwxrwxrwx   1 nobody root    0 Aug 18 15:10 state
> ```
> ...

 

Also check the permissions of /var, /var/lib, and /var/lib/nfs

----------

## xbmodder

did you 777 the state dir?

----------

## rmoerlan

Okay,

Here are my directory permissions after running chmod 777 on them all.  This is my first time really dealing with nfs since I started using Gentoo a few years ago so this one is a bit...  frustrating.

from the /var/lib/nfs tree:

```
drwxrwxrwx  12 root   root  4096 Aug 16 15:42 var

drwxrwxrwx  13 root root 4096 Aug 18 09:17 lib

drwxrwxrwx   6 root root    4096 Aug 22 09:02 nfs

```

It appears I'm still getting that same stupid error.  Is there a way to know whether rpc.statd is running with proper priveledges?

----------

## buchan

I'm having the same problem on a fresh install. Anyone discover the solution?

----------

## kik

Same here, fresh 2005.1 install also. Running 2.6.12-gentoo-r9. I tried disabling NFS V4 support in the kernel, still getting the error :

```
Sep  2 12:44:14 nostromo Installing knfsd (copyright (C) 1996 okir@monad.swb.de).

Sep  2 12:44:14 nostromo rpc.statd[11047]: Version 1.0.6 Starting

Sep  2 12:44:14 nostromo rpc.statd[11047]: open (/var/lib/nfs/state): Permission denied

Sep  2 12:44:14 nostromo rc-scripts: Error starting NFS statd

```

I checked the permissions in /var/lib/nfs :

```
nostromo ~ # ls -al /var/lib/nfs

total 8

drwxr-xr-x   5 root   root   99 Sep  2 11:47 .

drwxr-xr-x  14 root   root 4096 Sep  2 10:50 ..

-rw-r--r--   1 root   root    0 Sep  2 10:52 .keep

-rw-r--r--   1 root   root  156 Sep  2  2005 etab

-rw-r--r--   1 root   root    0 Sep  2 10:50 rmtab

drwxr-xr-x   2 nobody root   18 Sep  2 10:52 sm

drwxr-xr-x   2 nobody root   18 Sep  2 10:52 sm.bak

-rw-------   1 nobody root    0 Sep  2 10:50 state

drwxr-xr-x   2 root   root   18 Sep  2 10:52 v4root

-rw-r--r--   1 root   root    0 Sep  2 10:50 xtab

```

chmod'ing 777 /var/lib/nfs and /var/lib/nfs/state does not change anything.

Could this be a bug introduced by 2.6.12-gentoo-r9 as I have no problem on other servers running 2.6.12-gentoo-r6 ?

----------

## kik

Solved the issue with "chown root:root sm sm.bak state" in /var/lib/nfs :

```
ls -al

total 12

drwxr-xr-x   6 root root  116 Sep  2 15:48 .

drwxr-xr-x  14 root root 4096 Sep  2 10:50 ..

-rw-r--r--   1 root root    0 Sep  2 13:07 .keep

-rw-r--r--   1 root root  156 Sep  2 15:48 etab

-rw-r--r--   1 root root    0 Sep  2 10:50 rmtab

drwxr-xr-x   2 root root    6 Sep  2 13:05 rpc_pipefs

drwxr-xr-x   2 root root   18 Sep  2 13:07 sm

drwxr-xr-x   2 root root   18 Sep  2 13:07 sm.bak

-rw-------   1 root root    4 Sep  2 15:48 state

drwxr-xr-x   2 root root   18 Sep  2 13:07 v4root

-rw-r--r--   1 root root    0 Sep  2 10:50 xtab

```

Now statd starts correctly, this is what I get in the syslog though :

```
Sep  2 15:48:08 nostromo rpc.statd[12561]: Version 1.0.6 Starting

Sep  2 15:48:08 nostromo rpc.statd[12561]: statd running as root. chown /var/lib/nfs/sm to choose different user

```

I am not sure if this poses a security threat of some sort. Does anybody know the implications of running rpc.statd as root ?Last edited by kik on Wed Sep 21, 2005 9:51 am; edited 1 time in total

----------

## buchan

If you don't want it to run as root try 'chown nobody:nobody'. 

Although I wonder what is the real cause of this... all my other boxes are nobody:root.

----------

## kik

Thanks for the tip. I just did a "chown nobody:nobody sm sm.bak state" in "/var/lib/nfs" :

```
nostromo nfs # ls -al

total 12

drwxr-xr-x   6 root   root    116 Sep  5 12:57 .

drwxr-xr-x  14 root   root   4096 Sep  2 10:50 ..

-rw-r--r--   1 root   root      0 Sep  2 13:07 .keep

-rw-r--r--   1 root   root    156 Sep  5 12:56 etab

-rw-r--r--   1 root   root      0 Sep  2 10:50 rmtab

drwxr-xr-x   2 root   root      6 Sep  2 13:05 rpc_pipefs

drwxr-xr-x   2 nobody nobody   18 Sep  2 13:07 sm

drwxr-xr-x   2 nobody nobody   18 Sep  2 13:07 sm.bak

-rw-------   1 nobody nobody    4 Sep  5 12:57 state

drwxr-xr-x   2 root   root     18 Sep  2 13:07 v4root

-rw-r--r--   1 root   root      0 Sep  2 10:50 xtab

```

and restarted nfs and netmount. Now rpc.statd starts with no warning :

```
Sep  5 12:57:39 nostromo rpc.statd[12532]: Version 1.0.6 Starting

```

I confirm all my other Gentoo boxes have nobody:root for these files as well.

----------

## heilong

I've had the same problem on a new box. Doing

"chown nobody:nobody sm sm.bak state" fixed it. The same files are owned by nobody:root on my notebook and work fine.

I really wonder what's the problem with it?

----------

## Tony240zt

I had the same prob with a fresh install box

chmod 755 /

fixed the problem.

It was 

d-wxr----t  19 root root   440 Jul 30  2005 .

----------

