Can't enable nfs-idmap, rpcbind, nfs.service on boot?

General support questions
Post Reply
banjaxt
Posts: 9
Joined: 2015/08/24 14:17:36

Can't enable nfs-idmap, rpcbind, nfs.service on boot?

Post by banjaxt » 2015/08/24 14:31:22

Hi,

I've got the latest nfs-utils installed.
I'm trying to enable the following services on boot but they are coming up Active: inactive (dead) when I request status.

systemctl enable nfs-lock
systemctl enable nfs-idmap

When I run these commands I get:
Failed to issue method call: No such file or directory

So I tried inserting symlinks in /etc/systemd/system/basic.target.wants:

ln -s /usr/lib/systemd/system/rpc-statd.service ./nfs-lock
and
ln -s /usr/lib/systemd/system/nfs-idmapd.service ./nfs-idmap

Yet when I run systemctl status with nfs-lock or nfs-idmap the service shows as Active: inactive (dead)

When I look in /usr/lib/systemd/system it seems that these services have sym-links which just point to the service name (without any path) - and I can't find the service names in root, so I'm a bit stuck.

Any ideas how to get these enabled on boot in CentOS 7?
Am I putting them in the wrong .target.wants directory?

aks
Posts: 3008
Joined: 2014/09/20 11:22:14

Re: Can't enable nfs-idmap, rpcbind, nfs.service on boot?

Post by aks » 2015/08/24 15:49:21

So the way I'm reading this is that they do start but fail in some manner (as in
they are coming up Active: inactive (dead) when I request status.
)
When I run these commands I get:
Failed to issue method call: No such file or directory
Probably a clue as to what is wrong.
Any entries in journalctl?

banjaxt
Posts: 9
Joined: 2015/08/24 14:17:36

Re: Can't enable nfs-idmap, rpcbind, nfs.service on boot?

Post by banjaxt » 2015/08/24 16:40:42

Thanks for the reply aks!

I (think) I've worked it out in the end.

Please if anyone can sanity check this solution that would be great :D

IMO it was a bug in RHEL which I reckon made it into CentOS7 where the service's unit files were aliased and had no [Install] parameters.

https://bugzilla.redhat.com/show_bug.cgi?id=1159308 - references the issue in RHEL

nfs-lock.service is actually called rpc-statd.service when you look in /usr/lib/systemd/system/nfs-lock.service - it's a symlink > rpc-statd.service
nfs-imap.service is actually called nfs-idmapd.service when you look in /usr/lib/systemd/system/nfs-lock.service - it's a symlink > nfs-idmapd.service

I also noticed when I opened the unit files in /usr/lib/systemd/system that they had no [Install] parameter, so I've added this to the bottom of the files for both nfs-idmap.service and nfs-lock.service:

[Install]
WantedBy=multi-user.target

This allowed me to run:

systemctl enable rpc-statd.service
and
systemctl enable nfs-idmapd.service

Both inserted symlinks in /etc/systemd/system/multi-user.target.wants for both nfs-idmapd.service and rpc-statd.service.

Does this sound like a sane solution?
Both services now report as enabled and Active: running after boot. :D

banjaxt
Posts: 9
Joined: 2015/08/24 14:17:36

Re: Can't enable nfs-idmap, rpcbind, nfs.service on boot?

Post by banjaxt » 2015/08/25 08:28:30

Can anyone sanity check this solution for me?
Just want to check I haven't done anything stupid :)

banjaxt
Posts: 9
Joined: 2015/08/24 14:17:36

Re: Can't enable nfs-idmap, rpcbind, nfs.service on boot?

Post by banjaxt » 2015/08/26 15:05:37

BUMP!

Anyone? I'm kinda new to CentOS7 and want to check I haven't done anything dumb here ^^^^ :oops:

aks
Posts: 3008
Joined: 2014/09/20 11:22:14

Re: Can't enable nfs-idmap, rpcbind, nfs.service on boot?

Post by aks » 2015/08/26 16:05:29

If it works for you and does what you need it to do, then yes it's fixed.
Reading the (very long) bug thing you posted, RH seems to be suggesting that we don't want to allow /etc/systemd/ to be used, which is one of the things that systemd said was fine, so I don't know what RH's plan is for the future.
But yes, it seems logical to me. I'm just not sure what'll break in the future - generally if you overwrite an RPM supplied file with your own, it will be not changed when you install the next RPM that provides that file (so during an update/upgrade for example).

banjaxt
Posts: 9
Joined: 2015/08/24 14:17:36

Re: Can't enable nfs-idmap, rpcbind, nfs.service on boot?

Post by banjaxt » 2015/08/26 16:07:01

aks wrote:If it works for you and does what you need it to do, then yes it's fixed.
Reading the (very long) bug thing you posted, RH seems to be suggesting that we don't want to allow /etc/systemd/ to be used, which is one of the things that systemd said was fine, so I don't know what RH's plan is for the future.
But yes, it seems logical to me. I'm just not sure what'll break in the future - generally if you overwrite an RPM supplied file with your own, it will be not changed when you install the next RPM that provides that file (so during an update/upgrade for example).
Cheers Aks! Much appreciated 8-)

mancoast
Posts: 1
Joined: 2015/10/11 21:44:48

Re: Can't enable nfs-idmap, rpcbind, nfs.service on boot?

Post by mancoast » 2015/10/11 22:03:39

CentOS7 20151010 NFS Daemons
I experience this issue.
service nfs-lock status #<-- Error
service nfs-idmap status #<-- Error
NFS_System_CentOS-before.png
NFS_System_CentOS-before.png (119.93 KiB) Viewed 36607 times
Resolution will solve the follow issues.
systemctl enable nfs-lock Failed to issue method call: No such file or directory
systemctl enable nfs-idmap Failed to issue method call: No such file or directory

Requires Files Modification:
/usr/lib/systemd/system/nfs-lock.service
/usr/lib/systemd/system/nfs-idmapd.service

Append text to /usr/lib/systemd/system/nfs-idmap.service
[Install]
WantedBy=multi-user.target


Append text to /usr/lib/systemd/system/nfs-lock.service
[Install]
WantedBy=nfs.target


Enable the services:
systemctl enable nfs-idmapd.service
systemctl enable rpc-statd.service

I had to Add filewall rules: (optional)
firewall-cmd --permanent --zone public --add-service mountd
firewall-cmd --permanent --zone public --add-service rpc-bind
firewall-cmd --permanent --zone public --add-service nfs
firewall-cmd --reload

I had to enable the socket: (optional)
systemctl enable rpcbind.socket

Reboot System and check status
systemctl status rpc-statd.service –l
systemctl status nfs-idmapd.service -l
NFS_System_CentOS-post0.png
NFS_System_CentOS-post0.png (120.79 KiB) Viewed 36607 times
Rest assured.
NFS_System_CentOS-post1.png
NFS_System_CentOS-post1.png (146.05 KiB) Viewed 36607 times

banjaxt
Posts: 9
Joined: 2015/08/24 14:17:36

Re: Can't enable nfs-idmap, rpcbind, nfs.service on boot?

Post by banjaxt » 2015/10/13 08:07:30

mancoast wrote:CentOS7 20151010 NFS Daemons
I experience this issue.
service nfs-lock status #<-- Error
service nfs-idmap status #<-- Error
NFS_System_CentOS-before.png
Resolution will solve the follow issues.
systemctl enable nfs-lock Failed to issue method call: No such file or directory
systemctl enable nfs-idmap Failed to issue method call: No such file or directory

Requires Files Modification:
/usr/lib/systemd/system/nfs-lock.service
/usr/lib/systemd/system/nfs-idmapd.service

Append text to /usr/lib/systemd/system/nfs-idmap.service
[Install]
WantedBy=multi-user.target


Append text to /usr/lib/systemd/system/nfs-lock.service
[Install]
WantedBy=nfs.target


Enable the services:
systemctl enable nfs-idmapd.service
systemctl enable rpc-statd.service

I had to Add filewall rules: (optional)
firewall-cmd --permanent --zone public --add-service mountd
firewall-cmd --permanent --zone public --add-service rpc-bind
firewall-cmd --permanent --zone public --add-service nfs
firewall-cmd --reload

I had to enable the socket: (optional)
systemctl enable rpcbind.socket

Reboot System and check status
systemctl status rpc-statd.service –l
systemctl status nfs-idmapd.service -l
NFS_System_CentOS-post0.png
Rest assured.
NFS_System_CentOS-post1.png
Yep, that's basically what I had to do to fix it :)

Post Reply

Return to “CentOS 7 - General Support”