web-dev-qa-db-ja.com

Fedora 17にNFS 3ボリュームをマウントする方法は?

パッケージをインストールしました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

OK、おそらく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.

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.

さて、質問は次のとおりです:どの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

パッケージが欠落していますか、それとも間違ったサービスを使用していますか?

5
maxschlepzig

SElinuxのエラーが表示されなかったため、これが役立つかどうかはわかりません。

Fedora 17をインストールした後、最新リリースにアップグレードしましたが、再起動しませんでした。いくつかのgnomeパッケージが更新されたため、ログアウトして再度ログインしました。 (更新にsystemdの更新も含まれていることに気付きませんでした。)

NFS共有をマウントするためにインストールしたnfs-utilsとrpcbindサービスを開始しようとしました:

Sudo systemctl start rpcbind.service

次のエラーを受け取りました:

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は最近削除されたようですyum whatprovides を示す systemd-44-8.fc17まだありました。

他のいくつかのNFSサービスが同じエラーをスローしました。

私の場合、再起動するだけで解決しました。そのため、最新のパッケージに更新して再起動したい場合があります。 (誰かがsystemdを再起動せずにそれを再設定する方法を知っているなら、私に知らせてください。)

5
Bram

開始する必要があるサービスの名前は、Fedora 17では「nfslock」です。

systemctl start nfslock

nfs-utilsをインストールした後、すでに有効になっています

2
Kaveh Minooie

開始しているようですnfs-lock.service via systemdは、コマンドラインからNFS 3マウントを行うための前提条件ではありません。

実行するだけ

# mount -t nfs server:/mnt /mnt

(後に nfs-utilsパッケージがインストールされている場合)rpc.statd-SELinuxエラーメッセージは表示されません。マウントされたNFSエクスポートは問題なく使用できます。

カーネルはsystemdと対話せずにオンデマンドでrpc.statd(およびその仲間)を起動するだけのようです。

# pgrep -l rpc
3063 rpc.statd
22599 rpciod
24280 rpcbind
0
maxschlepzig