yum -y install autofs 先执行这条命令

 systemctl restart autofs 重启一下

[root@pc2 ~]# ls /misc   #什么都没有

[root@pc2 ~]# ls /misc   #还是什么都没有

[root@pc2 ~]# ls /misc/cd    #达到出发条件

触发挂载_autofs

ls /etc/auto.master   #这是它的监控目录

打开之后是这样的

触发挂载_触发挂载_02

可以修改

触发挂载_触发挂载_03

修改完之后创建一下,

vim /opt/bee.txt

触发挂载_触发挂载_04

进入编辑内容

ruirui   -fstype=iso9660  :/dev/cdrom

触发挂载_触发挂载_05

 systemctl restart autofs 再重启一下

触发挂载_触发挂载_06

查看一下

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 ~]# 

触发挂载_autofs_07