# Unable to start NFS/RPC server

## ajaygautam

Hello,

I am trying to setup RPC services on my Gentoo (1.4rc2) box. I have NFS (v2) client and server as modules in my kernel. Also emerge nfs-utils.

My /etc/hosts.allow look like:

======================

portmap: 192.168.1.0

lockd:   192.168.1.0

rquotad: 192.168.1.0

mountd:  192.168.1.0

statd:   192.168.1.0

ALL: 127.0.0.0/8

======================

and hosts.deny contains a single line: "ALL:ALL"

When, I "/etc/init.d/nfs start", I get:

======================

 * Starting NFS statd...                                                                                                                [ ok ]

 * Exporting NFS directories...                                                                                                         [ ok ]

 * Starting NFS rquotad...

Cannot register service: RPC: Unable to receive; errno = Connection refused

 * Error starting NFS rquotad                                                                                                           [ !! ]

 * Starting NFS daemon...

 * Error starting NFS daemon                                                                                                            [ !! ]

 * Starting NFS mountd...

Cannot register service: RPC: Unable to receive; errno = Connection refused

 * Error starting NFS mountd                                                                                                            [ !! ]

======================

I don't care about quotas, so I think, I did not compile it into the kernel.

Can anyone please help me get NFS server up and running on my Gentoo box.

Thanks

----------

## Decibels

Hmmm, can't duplicate it on mine. Even took portmap out of default. But anyway, I found this on google.

 *Quote:*   

>  If portmap is not started....
> 
> -->
> 
>     # /usr/sbin/rpc.rquotad
> ...

 

So, did you make sure that portmap is started or added to default?

Then make sure your /etc/hosts file has the ip addresses and aliases.

```
127.0.0.1   localhost

192.168.0.2     ComapaqGentoo Compaq

192.168.0.1     athlonbox.mydomain.lan Athlon
```

Also have you put you information in /etc/exports?

```
# /etc/exports: NFS file systems being exported.  See exports(5).

/ 192.168.0.2(ro)

```

That is your: mount directory on the other machine, the IP ADDRESS,(options).  Then run command exportfs -rv or reboot.

----------

## ajaygautam

Decibels,

Thanks a ton.

I did:

/etc/init.d/portmap start

/etc/init.d/nfs start

and now nfs services are up. I guess portmap was missing.

Thanks  :Smile: 

Ajay Gautam

----------

## aquadog

why dont they just add portmap to the deps section of /etc/init.d/nfs ? cos surely nfs NEEDS portmap to start?

----------

## kerframil

 *Quote:*   

> why dont they just add portmap to the deps section of /etc/init.d/nfs ?

 

From /etc/init.d/nfs:

```
depend() {

        need net portmap

}
```

It's not entirely clear why this individual was experiencing the problem.

----------

## ajaygautam

```
depend() {

        need net portmap

}
```

I saw this in my nfs startup script too, but somehow, portmap does not get started with this. Maybe this could be since portmap needed to be started first time.

I added portmap and nfs both to default, so I hope nfs will startup at reboot (if I need to reboot, that is  :Cool:   )

Thanks for the help and comments

Ajay Gautam

----------

## OdinsDream

This solution slightly worked on my setup. I was getting the same RPC errors when I executed /etc/init.d/nfs start.

Since this thread, I started portmap and now the nfs startup looks much nicer... more things are [ ok ], but now I get this:

```

 * Starting NFS statd...                                                                                          [ ok ]

 * Exporting NFS directories...                                                                                   [ ok ]

 * Starting NFS rquotad...                                                                                        [ ok ]

 * Starting NFS daemon...

 * Error starting NFS daemon                                                                                      [ !! ]

 * Starting NFS mountd...                                                                                         [ ok ]

```

No explanation as to why?

-- Edit --

Now it works. I stopped nfs, and started it again, everything [  ok  ]'s for me. No idea what was wrong.

----------

## petu

That's because you need to have all hosts listed in /etc/hosts that are listed in /etc/exports.

----------

## Pusikas

I seem to have a similar problem.  The NFS Daemon refuses to start. The other services do not seem to cause any problem. The clients are listed in /etc/hosts. It takes ages before the NFS Daemon to realizes that he has failed and gives up. The following line appears every 5 minutes or soin the log until the NFS Daemon gives up:

portmap: server localhost not responding, timed out

How can this be? I have a firewall running on my server, but it only blocks traffic from the outside.

Also, there are some very basic things about NFS that I do not understand. Do I need the NFS Server Support in the Kernel? Do I need NFS Client support in the Kernel to set up a server? The NFS FAQ from sourceforge is not a great help. Do I compile them as modules?

----------

## dol-sen

As I recall from the kernel's makemenuconfig help, you have two options, config & use the kernel NFS (compiled in or as modules) or emerge the standalone NFS daemons.

[edit] Sorry,  :Embarassed: I got it wrong.  That applies only to the server side 'nfsd'.   You still need the support of the rest of the nfs-utils package.   So you do not need to compile support for the server unless you want to use the kernel's built in 'nfsd'. they say it is faster than the standalone nfsd. [edit] 

You don't need both client & server on the server unless it is also a client for another server.

Brian

----------

## ripp

I had a similar problem when I enabled 'mmap io' in my kernel config.  This was gentoo-sources-2.4.19-r10 on a K6-2.  Disabling mmap'd io under networking options seemed to cure it.  I don't know wherein the bug lies, in the kernel/nfs/? but you might try disabling that...

----------

## zephyr1256

 *kerframil wrote:*   

>  *Quote:*   why dont they just add portmap to the deps section of /etc/init.d/nfs ? 
> 
> From /etc/init.d/nfs:
> 
> ```
> ...

 

I just encountered this problem and found the solution in this thread, although there was another twist to it for me.  I tried to start portmap with /etc/init.d/portmap start, and it warned me that the service was already running, but if I tried to stop the service first to restart it I got the exclamation marks.  ps -ef | grep portmap and sure enough, there was no portmap process, so I started /sbin/portmap, which allowed me to stop the service and then start it again, and the nfs service could be started.

----------

