Fedora 17에 NFS 3 볼륨을 마운트하는 방법은 무엇입니까?

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

좋아, 아마도 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

패키지가 누락되었습니까? 아니면 잘못된 서비스를 사용하고 있습니까?

답변1

SElinux 오류를 보지 못했기 때문에 이것이 도움이 될지 확실하지 않습니다.

Fedora 17을 설치한 후 최신 릴리스로 업그레이드했지만 재부팅하지 않았습니다. 여러 그놈 패키지 업데이트로 인해 로그아웃했다가 다시 로그인했습니다. (업데이트에 다음 업데이트 systemd도 포함되어 있다는 것을 알지 못했습니다 .)

NFS 공유를 마운트하기 위해 nfs-utilsrpcbind 서비스를 설치하고 시작하려고 했습니다.

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 서비스에서도 동일한 오류가 발생했습니다.

제 경우에는 재부팅만 하면 도움이 되었습니다. 따라서 최신 패키지로 업데이트하고 재부팅하는 것이 좋습니다. (누군가 재부팅하지 않고 시스템 구성을 다시 읽을 수 있는 방법을 알고 있다면 알려주세요.)

답변2

시작해야 하는 서비스 이름은 fedora 17에서 'nfslock'이므로 다음과 같습니다.

systemctl start nfslock

nfs-utils를 설치한 후에는 이미 활성화되어 있습니다.

답변3

nfs-lock.servicesystemd를 통해 시작하는 것이 실제로 명령줄에서 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

관련 정보