0

I have a fresh install of Centos 7. I cannot seem to auto mount an NFS share located on 192.168.254.105:/srv/nfsshare from the Centos client.

Mounting the share manually however, works perfectly.

/etc/auto.master has been commented out completely to simplify the problem, save for the following line:

/-       /etc/auto.nfsshare 

/etc/auto.nfsshare holds the following line:

/tests/nfsshare       -fstype=nfs,credentials=/etc/credentials.txt    192.168.254.105:/srv/nfsshare

/etc/credentials.txt holds:

 user=user
 password=password

The expected behavior is that when I ls -l /tests/nfsshare, I will see a few files that my fileserver's /srv/nfsshare directory holds.

It does not. Instead, it shows nothing.

The logs from sudo journalctl --unit=autofs.service shows this when it starts (debug enabled):

 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.

The following appears in my logs when I attempt to force mounting of the nfs share via 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

Additionally, ls -l /tests/nfsshare actually produces the error:

 ls: cannot access nfsshare/: No such file or directory

How can I fix this issue? As stated before, manual mounting the share works fine.

EDIT:

/var/log/audit/audit.log output immediately after sudo restart autofs and a couple of ls -l /tests/nfsshare to generate some error messages:

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'
2
  • Is SELinux enabled and are there any related log messages in /var/log/audit/audit.log?
    – user9517
    Nov 19, 2015 at 17:47
  • SELinux is set to "enforcing". Now I've set it to "permissive", restarted autofs, tried to ls /tests/nfsshare. No changes, same errors in journalctl --unit=autofs. Now posting the latest messages from the specified log file.. Nov 19, 2015 at 18:06

0

You must log in to answer this question.

Browse other questions tagged .