Debian or Raspbian: nfs-kernel-server not starting portmapper is not running

作者: lesca 分类: Tutorials 发布时间: 2016-05-04 21:08

Error Message

Debian or Raspbian: nfs-kernel-server not starting portmapper is not running … (warning) rpcbind.target

Fix Steps

Here is my first try, but it doesn’t work for me. It just reset the configs. So if you messed it up, try this first.

apt-get purge rpcbind nfs-kernel-server nfs-common
apt-get install nfs-kernel-server

Now check the service startup dependencies by command below. And make sure you find rpcbind before nfs service.

systemctl list-dependencies nfs-kernel-server.service

If it is not, unfortunately you should try purge and install them again as mentioned above, which should fixes the dependency issue and will also remove the config files, like /etc/exports. Backup it in advance if necessary!

 

Next, I have a look into /etc/init.d/nfs-kernel-server and find its start level is 2 3 4 5. However, nfs-common and rpcbind have differenct run level, I change it to the same, i.e. 2 3 4 5.

# Have a look at these files' runlevel
/etc/init.d/nfs-kernel-server
/etc/init.d/nfs-common
/etc/init.d/rpcbind

This is the runlevel of nfs-kernel-server

### BEGIN INIT INFO
# Provides:          nfs-kernel-server
# Required-Start:    $remote_fs nfs-common $portmap $time
# Required-Stop:     $remote_fs nfs-common $portmap $time
# Should-Start:      $named
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Kernel NFS server support
# Description:       NFS is a popular protocol for file sharing across
#                    TCP/IP networks. This service provides NFS server
#                    functionality, which is configured via the
#                    /etc/exports file.
### END INIT INFO

Then try to update-rc.d the changed init scripts with defaults. First try fails. The trick is to remove and add them again.

update-rc.d -f rpcbind remove
update-rc.d rpcbind defaults

update-rc.d -f nfs-common remove
update-rc.d nfs-common defaults

update-rc.d -f nfs-kernel-server remove
update-rc.d nfs-kernel-server defaults

After that, check the order of the services. It should be rpcbind, nfs-common, and nfs-kernel-server.

Reboot the server, it works for me now! Cheers!

P.S.

I posted the solution at raspberrypi.stackexchange.com. If you find this helpful, vote if for me. Thank you.

版权声明

本文出自 Lesca 技术宅,转载时请注明出处及相应链接。

本文永久链接: https://www.lesca.cn/archives/debian-or-raspbian-nfs-kernel-server-not-starting-portmapper-is-not-running.html

如果觉得我的文章对您有用,请随意赞赏。您的支持将鼓励我继续创作!

3 Comments
  • Hatse Flats

    2016-12-07 at 05:57

    This was VERY helpful. Thank you so much.

  • Chris

    2017-02-05 at 02:58

    I have a question to your tutorial:
    “However, nfs-common and rpcbind have differenct run level, I change it to the same, i.e. 2 3 4 5.”

    How can I do this?

    Thank you very much for this tutorial.

    1. lesca

      2017-05-04 at 15:28

      Hi Chris, you should find the following files
      /etc/init.d/nfs-common
      /etc/init.d/rpcbind

      and edit the “Default-Start” to 2 3 4 5