# /etc/init.d/nfs start   <<< Fails to start. [solved]

## petty123

I'm trying to install a new NFS server/client. Everything went well up until I've tried to start the nfs server...

This is the std output:

```

amd64-4400 sasc-ng # /etc/init.d/nfs start

 * Starting idmapd ...                                                               [ !! ]

 * Starting gssd ...

warning: unable to open /etc/gssapi_mech.conf: errno 2 (No such file or directory)

rpc.gssd: Problem with gssapi library                                                [ !! ]

 * Starting svcgssd ...

warning: unable to open /etc/gssapi_mech.conf: errno 2 (No such file or directory)   [ !! ]

 * Starting NFS statd ...                                                            [ ok ]

 * Exporting NFS directories ...

exportfs: /etc/exports [2]: Neither 'subtree_check' or 'no_subtree_check' specified for export "192.168.0.201/24:/nfsroot".

  Assuming default behaviour ('subtree_check').

  NOTE: this default will change with nfs-utils version 1.1.0                        [ ok ]

 * Starting NFS daemon ...

 * Error starting NFS daemon                                                         [ !! ]

 * Starting NFS mountd ...                                                           [ ok ]

```

This is the /var/log/messages:

```

Sep 25 21:22:35 amd64-4400 login(pam_unix)[5288]: session opened for user root by (uid=0)

Sep 25 21:22:35 amd64-4400 login[5757]: ROOT LOGIN  on 'tty2'

Sep 25 21:29:06 amd64-4400 mountd[5747]: Caught signal 15, un-registering and exiting.

Sep 25 21:29:06 amd64-4400 rpc.statd[5729]: Caught signal 15, un-registering and exiting.

Sep 25 21:29:12 amd64-4400 rpc.idmapd[6129]: main: open(/var/lib/nfs/rpc_pipefs/nfs): No such file or directory

Sep 25 21:29:12 amd64-4400 rpc.gssd[6131]: warning: no gssapi mechanisms loaded!

Sep 25 21:29:12 amd64-4400 rpc.gssd[6131]: Unable to obtain list of supported mechanisms. Check that gss library is properly configured.

Sep 25 21:29:12 amd64-4400 rpc.svcgssd[6133]: warning: no gssapi mechanisms loaded!

Sep 25 21:29:12 amd64-4400 rpc.svcgssd[6133]: Unable to obtain list of supported mechanisms. Check that gss library is properly configured.

Sep 25 21:29:12 amd64-4400 rpc.svcgssd[6133]: ERROR: Problem with gssapi library

Sep 25 21:29:12 amd64-4400 rpc.statd[6139]: Version 1.0.11 Starting

Sep 25 21:29:12 amd64-4400 rpc.statd[6139]: gethostbyname error for amd64-4400

Sep 25 21:29:12 amd64-4400 exportfs[6146]: /etc/exports [2]: Neither 'subtree_check' or 'no_subtree_check' specified for export "192.168.0.201/24:/nfsroot".   Assuming default behaviour ('subtree_check').   NOTE: this default will change with nfs-utils version 1.1.0

Sep 25 21:29:12 amd64-4400 nfsd[6151]: nfssvc: Function not implemented

Sep 25 21:29:12 amd64-4400 rc-scripts: Error starting NFS daemon

```

Looks like is looking for some missing config files, but I have no clue where to get them from..

Any networt gurus around, please? .

.Last edited by petty123 on Wed Sep 26, 2007 9:43 am; edited 3 times in total

----------

## Kosmas

Hello,

   When the NFS is compiled with kerberos flag you need the following dependencies that have gssapi:

net-libs/librpcsecgss

net-libs/libgssglue

app-crypt/mit-krb5

Emerge those and you will have support for kerberos

Alternatively you can tell nfs not to compile and use kerberos.

Hope I helped

Kosmas.

----------

## petty123

 *Kosmas wrote:*   

> Hello,
> 
>    When the NFS is compiled with kerberos flag you need the following dependencies that have gssapi:
> 
> net-libs/librpcsecgss
> ...

 

When I saw your message, I was hopping none of the above packages were installed, but unfortunately I have all three.

At your suggestion, I've also tried to emerge nfs-utils with USE="-kerberos", but the result was the same: nfs deamon does not start.

However the error messages changed somewhat (the gssapi error disappeared from eliminating kerberos and I also fixed gethostname error):

```

Sep 26 00:50:23 amd64-4400 login[5300]: ROOT LOGIN  on 'tty1'

Sep 26 00:52:46 amd64-4400 rpc.idmapd[16288]: main: open(/var/lib/nfs/rpc_pipefs/nfs): No such file or directory

Sep 26 00:52:46 amd64-4400 rpc.statd[16294]: Version 1.0.11 Starting

Sep 26 00:52:46 amd64-4400 exportfs[16301]: /etc/exports [2]: Neither 'subtree_check' or 'no_subtree_check' specified for export "192.168.0.201/24:/nfsroot".   Assuming default behaviour ('subtree_check').   NOTE: this default will change with nfs-utils version 1.1.0

Sep 26 00:52:46 amd64-4400 nfsd[16306]: nfssvc: Function not implemented

Sep 26 00:52:46 amd64-4400 rc-scripts: Error starting NFS daemon

```

But the problem is still unsolved. But thanks for answering, Kosmas.Last edited by petty123 on Wed Sep 26, 2007 7:58 am; edited 2 times in total

----------

## Kosmas

I know this is a stupid question to ask and you probably already have done it but is the portmap service started?

----------

## petty123

I should apologize to everyone. I really feel terible.

I solved the problem.  I started finally tht NSF deamon. It was just a stupid mistake: I had a mix-up in the grub config file and was booting the wrong kernel (with no NFS support).

----------

## fbcyborg

Hi there!

I have the same problem but, that messages apper:

```
* Starting gssd ...

  warning: unable to open /etc/gssapi_mech.conf: errno 2 (No such file or directory)

  rpc.gssd: Problem with gssapi library

* Starting svcgssd ...

  warning: unable to open /etc/gssapi_mech.conf: errno 2 (No such file or directory)
```

NFS and Portmap start without problems.

These packages are all installed:

```
net-libs/librpcsecgss

net-libs/libgssglue

app-crypt/mit-krb5 
```

What's going on?

----------

## desultory

Is /etc/gssapi_mech.conf present on that system?

----------

## fbcyborg

 *desultory wrote:*   

> Is /etc/gssapi_mech.conf present on that system?

 

No it isn't.

I also tried to do revdep-rebuild --library=gssapi but, there are no missing packages.

Do you think I have to re-emerge net-fs/nfs-utils ?

----------

## desultory

The missing file is a configuration file, not a library.

----------

## fbcyborg

Ok, I tried to emerge again nfs-utils and it didn't create a new one actually.

What can I do? 

I'm sure I didn't manually deleted it.

----------

## petty123

 *fbcyborg wrote:*   

> Ok, I tried to emerge again nfs-utils and it didn't create a new one actually.
> 
> What can I do? 
> 
> I'm sure I didn't manually deleted it.

 

Your problem is generated by kerberos.  If you emerge nfs-utils with USE="-kerberos" your error will disappear. If you do not need the security, nfs-utils work just fine without kerberos.

To get gssapi working correctly you must properly configure kerberos, and GENERATE the right keys. 

Each principal has a secret key known only to it and Kerberos. Principals includes servers, such as an FTP server or X server, and human users, whose key is their password. Users gain access to services by getting Kerberos tickets for those services from a Kerberos server.

Here is an example of gssapi_mech.conf:

```

# GSSAPI Mechanism Definitions

#

# This configuration file determines which GSS-API mechanisms

# the gssd code should use

#

# NOTE:

# The initiaiization function "mechglue_internal_krb5_init"

# is used for the MIT krb5 gssapi mechanism.  This special

# function name indicates that an internal function should

# be used to determine the entry points for the MIT gssapi

# mechanism funtions.

#

# library                               initialization function

# ================================   ==========================

# The MIT K5 gssapi library, use special function for initialization.

/usr/lib/libgssapi_krb5.so     mechglue_internal_krb5_init

#

# The SPKM3 gssapi library function.  Use the function spkm3_gss_initialize.

# /usr/local/gss_mechs/spkm/spkm3/libgssapi_spkm3.so    spkm3_gss_initialize

```

Try searching for kerberos keys in this forum and on google.

----------

## fbcyborg

Thank you petty, 

I placed your config file in /etc directory and I don't receive that error messages anymore.

But I noticed that "[!!]" appear on the same row of "* Starting svcgssd ..." so I checked /var/log/message file, wich reports the following errors:

```
rpc.svcgssd[5424]: warning: no gssapi mechanisms loaded!

rpc.svcgssd[5424]: Unable to obtain list of supported mechanisms. Check that gss library is properly configured.

rpc.svcgssd[5424]: ERROR: Problem with gssapi library

rpc.svcgssd[5430]: warning: no gssapi mechanisms loaded!

rpc.svcgssd[5430]: Unable to obtain list of supported mechanisms. Check that gss library is properly configured.

rpc.svcgssd[5430]: ERROR: Problem with gssapi library

rpc.svcgssd[5428]: ERROR: GSS-API: error in gss_acquire_cred(): Unspecified GSS failure.  Minor code may provide more information - No such file or directory

rpc.svcgssd[5428]: Unable to obtain credentials for 'nfs'

rpc.svcgssd[5428]: unable to obtain root (machine) credentials

rpc.svcgssd[5428]: do you have a keytab entry for nfs/<your.host>@<YOUR.REALM> in /etc/krb5.keytab?

```

I think there was a trobule when I unmerged old libgssapi. libgssglue package is the substitute, isn't it? Maybe that substitution caused some problem.

----------

## petty123

I see no reason to go with half backed solutions, just to get rid of error messages....

IMHO, there are just two basic choices: 

1. Get rid of kerberos by re-emerging nfs-utils with USE="-kerberos"

2. Implement fully ALL kerberos requirements.

Personally, I used option 1. Option 2 is a lot more complex, and unless you satisfy all kerberos needs, you shall have all sorts of errors.

Good luck!

----------

## fbcyborg

OK, thank you. Solved.

Note that on my notebook I don't have any trouble with kerberos USE flag enabled in nfs-utils package.. Why????

----------

