如何在 Fedora 17 上挂载 NFS 3 卷?

max*_*zig 5 fedora selinux nfs systemd

我安装了该软件包nfs-utils并通过以下方式进行了尝试:

# 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
Run Code Online (Sandbox Code Playgroud)

好的,可能需要启动 - 通过 systemd - 对吗?

# 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.
Run Code Online (Sandbox Code Playgroud)

看起来像 SELinux 相关的问题?

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.
Run Code Online (Sandbox Code Playgroud)

好的 - 现在的问题是:我必须更改什么 SELinux 配置或什么文件标签?

# 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
Run Code Online (Sandbox Code Playgroud)

是否缺少包裹 - 还是我使用了错误的服务?

Bra*_*ram 5

不确定这是否有帮助,因为我没有看到任何 SElinux 错误。

安装 Fedora 17 后,我升级到最新版本但没有重新启动。由于几个 gnome 软件包的更新,我确实注销并重新登录。(我没有注意到更新也包括更新systemd。)

要挂载我安装的 NFS 共享nfs-utils并尝试启动 rpcbind 服务:

sudo systemctl start rpcbind.service
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

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.
Run Code Online (Sandbox Code Playgroud)

var-run.mount 最近似乎已被删除,yum whatprovides表明它systemd-44-8.fc17仍然存在。

其他几个 NFS 服务也抛出了同样的错误。

在我的情况下,简单地重新启动有帮助。因此,您可能希望更新到最新的软件包并重新启动。(如果有人知道让 systemd 重新读取它的方法?无需重新启动的配置请告诉我。)