2

I need rpcbind service to be active after boot, so I installed it with yum, then started it by:

systemctl start rpcbind

it works. However after reboot it did not start. So I checked it with:

systemctl is-enabled rpcbind

and it showed: static which mean that some other service need it to boot, the service is rpcbind.socket, so I checked it and the rpcbind.socked showed that it is enabled (systemctl is-enabled rpcbind.socket returned enabled) but it does not work how it should

after boot when i execute:

systemctl status rpcbind

it show: failed (dead)

I have been searching for a while now this but without any luck, if anybody know a solution to this or faced this problem in the past then please help.

I'm using centos 7.1

if you need more information i can get it when i get to work tomorow

4
  • What version of rpcbind are you using?
    – nKn
    Sep 23, 2015 at 21:50
  • Does disabling selinux temporality do anything different? Sep 24, 2015 at 0:40
  • You can garner some info on why it is failing by running journalctl -xn. If that is not enlightening (in my experience, hardly ever) you may: 1. search for error messages in /var/log: grep -nrI rpcbind. This will produce much output, you will have to wade thru it. 2. Start rcpbind by hand, rpcbind -dw, and study its output. Sep 24, 2015 at 5:49
  • Although I had a same problem but got an another error message, I solved here; unix.stackexchange.com/a/256232/152138 Hope this helps you.
    – kujiy
    Jan 19, 2016 at 4:57

2 Answers 2

1

I've got the same problem on Debian 8 aka Jessie and, although systems are different, this solution could help, if you don't mind to alter configuration files.

Create file /etc/tmpfiles.d/rpcbind.conf:

#Type Path        Mode UID  GID  Age Argument
d     /run/rpcbind 0755 root root - -
f     /run/rpcbind/rpcbind.xdr 0600 root root - -
f     /run/rpcbind/portmap.xdr 0600 root root - -

Create /etc/systemd/system/rpcbind.service:

[Unit]
Description=RPC bind portmap service
After=systemd-tmpfiles-setup.service
Wants=remote-fs-pre.target
Before=remote-fs-pre.target
DefaultDependencies=no

[Service]
ExecStart=/sbin/rpcbind -f -w
KillMode=process
Restart=on-failure

[Install]
WantedBy=sysinit.target
Alias=portmap

and enabled above unit:

# systemctl enable rpcbind.service

Create /etc/systemd/system/nfs-common.service:

[Unit]
Description=NFS Common daemons
Wants=remote-fs-pre.target
DefaultDependencies=no

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/etc/init.d/nfs-common start
ExecStop=/etc/init.d/nfs-common stop

[Install]
WantedBy=sysinit.target

Enable it with:

# systemctl enable nfs-common

Presumably, that should do the trick for CentOS as well.

It also looks like there is a newer version of rpcbind-0.2.3, which has native systemd support, but haven't try it...

0

On centos 7.4, simple fix:

Create file: /etc/systemd/system/nfs-client.target.d/10-rpcbind.conf with the following contents:

[Unit]
Wants=rpcbind.service

disable and reenable rpcbind

sudo systemctl disable rpcbind
sudo systemctl enable rpcbind

restart

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .