rpcbind not started at boot on centos 7 with systemd

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

Jan

Posted 2015-09-23T21:40:29.047

Reputation: 161

What version of rpcbind are you using? – nKn – 2015-09-23T21:50:59.677

Does disabling selinux temporality do anything different? – Jacob Evans – 2015-09-24T00:40:57.150

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. – MariusMatutiae – 2015-09-24T05:49:59.363

Although I had a same problem but got an another error message, I solved here; http://unix.stackexchange.com/a/256232/152138 Hope this helps you.

– kujiy – 2016-01-19T04:57:37.040

Answers

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...

Timur Bakeyev

Posted 2015-09-23T21:40:29.047

Reputation: 36

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

JDL

Posted 2015-09-23T21:40:29.047

Reputation: 201