automount : force unlink on startup (-F) option does not work as expected
Issue
automount -F option deviates from expected behaviour, automount(8) :
-F, --force
Force an unlink umount of existing mounts under autofs managed mount points during startup. This can cause problems for processes with working directories within these mounts (see NOTES).
However, testing it :
[root@rhel77 ~]# automount -V | grep version
Linux automount version 5.0.7-109.el7
[root@rhel77 ~]# grep -iE "autofs|nfs" /proc/mounts
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=22,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=9826 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
/etc/auto.misc /misc autofs rw,relatime,fd=5,pgrp=7726,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=46267 0 0
-hosts /net autofs rw,relatime,fd=11,pgrp=7726,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=45820 0 0
/etc/auto.test /direct_test/test autofs rw,relatime,fd=17,pgrp=7726,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=45824 0 0
[root@rhel77 ~]# cd /direct_test/test
[root@rhel77 test]# pkill -9 automount
[root@rhel77 test]# /usr/sbin/automount -d --pid-file /run/autofs.pid -F
[root@rhel77 test]# grep -iE "autofs|nfs" /proc/mounts
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=22,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=9826 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
/etc/auto.test /direct_test/test autofs rw,relatime,fd=17,pgrp=7726,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=45824 0 0
rhel73:/5GBshare /direct_test/test nfs4 rw,relatime,vers=4.1,rsize=262144,wsize=262144,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.23.1.247,local_lock=none,addr=172.23.1.225 0 0
---> both autofs/NFS entries still present, autofs still have old process group
/etc/auto.misc /misc autofs rw,relatime,fd=7,pgrp=7756,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=45880 0 0
-hosts /net autofs rw,relatime,fd=13,pgrp=7756,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=46312 0 0
/etc/auto.test /direct_test/test autofs rw,relatime,fd=19,pgrp=7756,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=46316 0 0
Environment
- autofs affected versions higher than
autofs-5.0.7-106.el7and lower thanautofs-5.0.7-115.el7
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.