yum -y install autofs 先执行这条命令
systemctl restart autofs 重启一下
[root@pc2 ~]# ls /misc #什么都没有
[root@pc2 ~]# ls /misc #还是什么都没有
[root@pc2 ~]# ls /misc/cd #达到出发条件
ls /etc/auto.master #这是它的监控目录
打开之后是这样的
可以修改
修改完之后创建一下,
vim /opt/bee.txt
进入编辑内容
ruirui -fstype=iso9660 :/dev/cdrom
systemctl restart autofs 再重启一下
查看一下
ls /myauto/ruirui 这样就满足触发条件了
[root@pc2 ~]# ls /myauto/
[root@pc2 ~]# ls /myauto/ruirui
CentOS_BuildTag EULA images LiveOS repodata RPM-GPG-KEY-CentOS-Testing-7
EFI GPL isolinux Packages RPM-GPG-KEY-CentOS-7 TRANS.TBL
[root@pc2 ~]#