Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I installed the package nfs-utils and tried it via:

# mount -t nfs server:/mnt /mnt
mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified

Ok, probably need to start that - via systemd - right?

# systemctl start nfs-lock.service 
Job failed. See system journal and 'systemctl status' for details.
# journalctl
Jun 15 23:22:18 host rpc.statd[24339]: Version 1.2.6 starting
Jun 15 23:22:18 host rpc.statd[24339]: Opening /var/run/rpc.statd.pid failed:
                                         Permission denied
[..]
Jun 15 23:22:18 host systemd[1]: nfs-lock.service: control process exited, 
                                         code=exited status=1
Jun 15 23:22:18 host systemd[1]: Unit nfs-lock.service entered failed state.

Looks like a SELinux related problem?

Jun 15 23:22:18 host setroubleshoot[3211]: analyze_avc()
   avc=scontext=system_u:system_r:rpcd_t:s0
   tcontext=unconfined_u:object_r:var_run_t:s0
   access=['unlink'] tclass=file tpath=rpc.statd.pid
Jun 15 23:22:18 host setroubleshoot[3211]: SELinux is preventing
   /usr/sbin/rpc.statd from unlink access on the file rpc.statd.pid.
Jun 15 23:22:18 host setroubleshoot[3211]: analyze_avc()
   avc=scontext=system_u:system_r:rpcd_t:s0
   tcontext=unconfined_u:object_r:var_run_t:s0
   access=['write'] tclass=file tpath=rpc.statd.pid
Jun 15 23:22:18 host setroubleshoot[3211]: SELinux is preventing
   /usr/sbin/rpc.statd from write access on the file rpc.statd.pid.

Ok - now the question is: what SELinux configuration or what file label do I have to change?

# systemctl status nfs-lock.service
nfs-lock.service - NFS file locking service.
      Loaded: loaded (/usr/lib/systemd/system/nfs-lock.service; enabled)
      Active: failed (Result: exit-code) since Fri, 15 Jun 2012 23:22:18 +0200;
              13min ago
     Process: 24338 ExecStart=/sbin/rpc.statd $STATDARG
              (code=exited, status=1/FAILURE)
     Process: 24334 ExecStartPre=/usr/lib/nfs-utils/scripts/nfs-lock.preconfig
              (code=exited, status=0/SUCCESS)
      CGroup: name=systemd:/system/nfs-lock.service

Is a package missing - or am I using the wrong service?

share|improve this question
add comment

3 Answers

up vote 4 down vote accepted

Not sure if this will help because I did not see any SElinux errors.

But I'm posting what worked for me and the problems I encountered in the hope it helps.

After installing Fedora 17 I upgrade to the latest release but did not reboot. I did log out and back in because of the updates to several gnome packages. (I did not notice that the update included an update of systemd as well.)

To mount my NFS shares I installed nfs-utils and tried to start the rpcbind service:

sudo systemctl start rpcbind.service

I received the following error:

Failed to issue method call: Unit var-run.mount failed to load: No such file or directory. See system logs and 'systemctl status var-run.mount' for details.

var-run.mount appears to have been removed recently yum whatprovides shows that systemd-44-8.fc17 still had it.

Several other NFS services threw the same error.

In my case simply rebooting helped. So you might want to update to the latest packages and reboot. (If someone knows a way to make systemd reread itś config without rebooting please let me know.)

share|improve this answer
    
Hm, does systemctl start nfs-lock.service works on your system after the reboot? (Btw, the Fedora 17 system I am using was installed from scratch.) –  maxschlepzig Jun 17 '12 at 21:13
    
Yes, systemctl start nfs-lock.service worked for me, the service is currently "active (running)". This installation was also a fresh install using the Live-desktop ISO. pgrep -l shows rpcbind, rpciod, rpc.statd, rpc.idmapd and rpc.mountd now (and SElinux is enforcing as well). –  Bram Jun 18 '12 at 19:12
    
now it works after a reboot as well. systemctl status nfs-lock.service shows a successfully running service directly after the start. Cf. bugzilla.redhat.com/show_bug.cgi?id=832776 –  maxschlepzig Jun 20 '12 at 10:39
add comment

the name of the service that you have to start is 'nfslock' in fedora 17 so:

systemctl start nfslock

it is already enabled after you install nfs-utils

share|improve this answer
add comment

It looks like starting nfs-lock.service via systemd is not really a prerequisite for doing a NFS 3 mount from the command line.

Just executing

# mount -t nfs server:/mnt /mnt

(after the nfs-utils package is installed) results in a loaded rpc.statd - without further SELinux error messages. And the mounted NFS export is usable without problems.

It seems that the Kernel just starts rpc.statd (and friends) on demand without interacting with systemd:

# pgrep -l rpc
3063 rpc.statd
22599 rpciod
24280 rpcbind
share|improve this answer
    
After a reboot the service automatically is started during the boot sequence without a problem systemctl status nfs-lock.service report success. –  maxschlepzig Jun 20 '12 at 10:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.