If you are using autofs to mount your external shares (e.g. NAS) then you probably experienced the same issue like me. When you want to shutdown the computer it takes 3 minutes because the autofs service hangs and waits for the default time out. This is caused when e.g. the Network Manager disconnects your network during logout of your session but the autofs still runs. I have seen people posting to reduce the service timeout but a better solution is to
sudo systemctl edit autofs.service and add the option
ExecStop=umount. The file should look like this:
[Unit] Description=Automounts filesystems on demand After=network.target ypbind.service sssd.service network-online.target remote-fs.target rpc-statd.service rpcbind.service Wants=network-online.target rpc-statd.service rpcbind.service [Service] Type=notify EnvironmentFile=-/etc/default/autofs ExecStart=/usr/bin/automount $OPTIONS --systemd-service --dont-check-daemon ExecReload=/usr/bin/kill -HUP $MAINPID ExecStop=umount -a -f -t nfs KillMode=process TimeoutSec=180 [Install] WantedBy=multi-user.target
Of course you may want to alter the
nfs entry with your current network file protocol you access the external data, like
You would like to reload the services by
Now autofs should not cause a waiting time during shutdown anymore.
Hope this is useful for some but if you have got any other solution this would be awesome to know.