Проблемы с автонастройкой NFS делятся на Centos 7
У меня новая установка Centos 7. Я не могу автоматически смонтировать общий ресурс NFS, расположенный на 192.168.254.105:/srv/nfsshare
от клиента Centos.
Монтирование общего ресурса вручную работает отлично.
/etc/auto.master был полностью закомментирован для упрощения проблемы, за исключением следующей строки:
/- /etc/auto.nfsshare
/etc/auto.nfsshare содержит следующую строку:
/tests/nfsshare -fstype=nfs,credentials=/etc/credentials.txt 192.168.254.105:/srv/nfsshare
/etc/credentials.txt содержит:
user=user
password=password
Ожидаемое поведение таково, что когда я ls -l /tests/nfsshare
Я увижу несколько файлов, которые содержит каталог моего файлового сервера / srv / nfsshare.
Это не. Вместо этого он ничего не показывает.
Журналы из sudo journalctl --unit=autofs.service показывают это при запуске (отладка включена):
Nov 20 00:25:38 localhost.localdomain systemd[1]: Starting Automounts filesystems on demand...
Nov 20 00:25:38 localhost.localdomain automount[21204]: Starting automounter version 5.0.7-48.el7, master map auto.master
Nov 20 00:25:38 localhost.localdomain automount[21204]: using kernel protocol version 5.02
Nov 20 00:25:38 localhost.localdomain automount[21204]: lookup_nss_read_master: reading master files auto.master
Nov 20 00:25:38 localhost.localdomain automount[21204]: parse_init: parse(sun): init gathered global options: (null)
Nov 20 00:25:38 localhost.localdomain automount[21204]: spawn_mount: mtab link detected, passing -n to mount
Nov 20 00:25:38 localhost.localdomain automount[21204]: spawn_umount: mtab link detected, passing -n to mount
Nov 20 00:25:38 localhost.localdomain automount[21204]: lookup_read_master: lookup(file): read entry /-
Nov 20 00:25:38 localhost.localdomain automount[21204]: master_do_mount: mounting /-
Nov 20 00:25:38 localhost.localdomain automount[21204]: automount_path_to_fifo: fifo name /run/autofs.fifo--
Nov 20 00:25:38 localhost.localdomain automount[21204]: lookup_nss_read_map: reading map file /etc/auto.nfsshare
Nov 20 00:25:38 localhost.localdomain automount[21204]: parse_init: parse(sun): init gathered global options: (null)
Nov 20 00:25:38 localhost.localdomain automount[21204]: spawn_mount: mtab link detected, passing -n to mount
Nov 20 00:25:38 localhost.localdomain automount[21204]: spawn_umount: mtab link detected, passing -n to mount
Nov 20 00:25:38 localhost.localdomain automount[21204]: mounted direct on /tests/nfsshare with timeout 300, freq 75 seconds
Nov 20 00:25:38 localhost.localdomain automount[21204]: do_mount_autofs_direct: mounted trigger /tests/nfsshare
Nov 20 00:25:38 localhost.localdomain automount[21204]: st_ready: st_ready(): state = 0 path /-
Nov 20 00:25:38 localhost.localdomain systemd[1]: Started Automounts filesystems on demand.
В моих журналах появляется следующее сообщение, когда я пытаюсь принудительно смонтировать общий ресурс nfs через ls -l /tests/nfsshare:
Nov 20 00:48:05 localhost.localdomain automount[22030]: handle_packet: type = 5
Nov 20 00:48:05 localhost.localdomain automount[22030]: handle_packet_missing_direct: token 21, name /tests/nfsshare, request pid 22057
Nov 20 00:48:05 localhost.localdomain automount[22030]: attempting to mount entry /tests/nfsshare
Nov 20 00:48:05 localhost.localdomain automount[22030]: lookup_mount: lookup(file): looking up /tests/nfsshare
Nov 20 00:48:05 localhost.localdomain automount[22030]: lookup_mount: lookup(file): /tests/nfsshare -> -fstype=nfs,credentials=/etc/credenti...fsshare
Nov 20 00:48:05 localhost.localdomain automount[22030]: parse_mount: parse(sun): expanded entry: -fstype=nfs,credentials=/etc/credentials.tx...fsshare
Nov 20 00:48:05 localhost.localdomain automount[22030]: parse_mount: parse(sun): gathered options: fstype=nfs,credentials=/etc/credentials.txt
Nov 20 00:48:05 localhost.localdomain automount[22030]: [90B blob data]
Nov 20 00:48:05 localhost.localdomain automount[22030]: dev_ioctl_send_fail: token = 21
Nov 20 00:48:05 localhost.localdomain automount[22030]: failed to mount /tests/nfsshare
Nov 20 00:48:05 localhost.localdomain automount[22030]: handle_packet: type = 5
Nov 20 00:48:05 localhost.localdomain automount[22030]: handle_packet_missing_direct: token 22, name /tests/nfsshare, request pid 22057
Nov 20 00:48:05 localhost.localdomain automount[22030]: dev_ioctl_send_fail: token = 22
Кроме того, ls -l /tests/nfsshare фактически выдает ошибку:
ls: cannot access nfsshare/: No such file or directory
Как я могу исправить эту проблему? Как уже говорилось ранее, ручное крепление общего ресурса работает нормально.
РЕДАКТИРОВАТЬ:
/var/log/audit/audit.log выводится сразу после sudo restart autofs
и пару ls -l /tests/nfsshare
создать несколько сообщений об ошибках:
type=USER_END msg=audit(1447955572.809:1699): pid=23825 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_close grantors=pam_keyinit,pam_limits,pam_systemd,pam_unix,pam_xauth acct="root" exe="/usr/bin/su" hostname=? addr=? terminal=pts/5 res=success'
type=CRED_DISP msg=audit(1447955572.811:1700): pid=23825 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_unix acct="root" exe="/usr/bin/su" hostname=? addr=? terminal=pts/5 res=success'
type=SERVICE_START msg=audit(1447955718.341:1701): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg=' comm="fprintd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
type=USER_AUTH msg=audit(1447955721.421:1702): pid=23956 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:authentication grantors=pam_unix acct="jdoe" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/5 res=success'
type=USER_ACCT msg=audit(1447955721.427:1703): pid=23956 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:accounting grantors=pam_unix,pam_localuser acct="jdoe" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/5 res=success'
type=USER_CMD msg=audit(1447955721.428:1704): pid=23956 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='cwd="/home/jdoe" cmd=73797374656D63746C2072657374617274206175746F66732E73657276696365 terminal=pts/5 res=success'
type=CRED_ACQ msg=audit(1447955721.430:1705): pid=23956 uid=0 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_unix acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/5 res=success'
type=USER_START msg=audit(1447955721.431:1706): pid=23956 uid=0 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_open grantors=pam_keyinit,pam_limits acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/5 res=success'
type=SERVICE_STOP msg=audit(1447955721.677:1707): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg=' comm="autofs" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
type=SERVICE_START msg=audit(1447955721.820:1708): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg=' comm="autofs" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
type=USER_END msg=audit(1447955721.824:1709): pid=23956 uid=0 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_close grantors=pam_keyinit,pam_limits acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/5 res=success'
type=CRED_DISP msg=audit(1447955721.824:1710): pid=23956 uid=0 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_unix acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/5 res=success'
type=USER_AUTH msg=audit(1447955746.378:1711): pid=24013 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:authentication grantors=pam_unix acct="root" exe="/usr/bin/su" hostname=? addr=? terminal=pts/5 res=success'
type=USER_ACCT msg=audit(1447955746.385:1712): pid=24013 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:accounting grantors=pam_unix,pam_localuser acct="root" exe="/usr/bin/su" hostname=? addr=? terminal=pts/5 res=success'
type=CRED_ACQ msg=audit(1447955746.386:1713): pid=24013 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_unix acct="root" exe="/usr/bin/su" hostname=? addr=? terminal=pts/5 res=success'
type=USER_START msg=audit(1447955746.427:1714): pid=24013 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_open grantors=pam_keyinit,pam_limits,pam_systemd,pam_unix,pam_xauth acct="root" exe="/usr/bin/su" hostname=? addr=? terminal=pts/5 res=success'
type=SERVICE_STOP msg=audit(1447955748.277:1715): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg=' comm="fprintd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'