I've setup autofs on Centos 7. However, it seems like after reboot, it took some time to mount /home/ directory, even when I 'cd' into it. It only succeeds after 3 tries:
[root@localhost ~] cd /home/<user> -bash: cd: /home/<user>: No such file or directory
and, autofs is enabled, so I expect it to start after reboot:
[root@localhost etc]# systemctl status autofs autofs.service - Automounts filesystems on demand Loaded: loaded (/usr/lib/systemd/system/autofs.service; enabled) Active: active (running) since Tue 2015-07-21 10:34:38 HKT; 1h 13min ago Process: 1379 ExecStart=/usr/sbin/automount $OPTIONS --pid-file /run/autofs.pid (code=exited, status=0/SUCCESS) Main PID: 1385 (automount) CGroup: /system.slice/autofs.service └─1385 /usr/sbin/automount --pid-file /run/autofs.pid Jul 21 10:34:38 localhost.localdomain systemd: Starting Automounts filesystems on demand... Jul 21 10:34:38 localhost.localdomain automount: setautomntent: lookup(sss): setautomntent: No such file or directory Jul 21 10:34:38 localhost.localdomain systemd: Started Automounts filesystems on demand.
Here is /etc/auto.master:
/misc /etc/auto.misc /net -hosts +dir:/etc/auto.master.d /home /etc/auto.home /san /etc/auto.san +auto.master
* -fstype=nfs,rw 18.104.22.168:/home_external/user_home_local/&
I suspect for similar reasons, when mysql starts after reboot, it has an error saying it can't 'cd' into /san/mysql_db/. But a manual restart on mysql after the machine is booted up works. Any ideas? thanks vm