2

I have autofs mounting nfs and cifs shares. Everything is great except for slow shutdowns and reboots. I find the message "A stop job is running for Automounts filesystems on demand" with a 3 min countdown. So this is what is causing the delay. But I can't find where to adjust the 3 minutes to something shorter or to direct autofs to unmount everything immediately. What can I do to speed up shutdown or reboot?

0

2 Answers 2

0

I have been having the same problem for ages and I use autofs extensively in my local network. The only way I have found around the problem is to open a terminal and issue the command:

sudo systemctl stop autofs

After this the systems shut down as normal.

0

It should be because the network interface get deactivated before the autofs service is stopped.

I encountered the same issue in KDE where I set up a WIFI connection from the GUI and have the "All users may connect to this network" option untick, making the interface get deactivated before autofs.service is stopped during the shutdown.

Adding umount command to scripts under /etc/NetworkManager/dispatcher.d/ doesn't help either as they are not invoked in the shutdown.

Found 2 workarounds

  1. One option is to tick the "All users may connect to this network" option in the Network Manager. It will maintain the WiFi even KDE exit. Then create and the following line to /etc/polkit-default-privs/local. Otherwise the KDE will keep prompting for password to activate the connection every time it starts up or wakes up from a sleep.

    org.freedesktop.NetworkManager.settings.modify.system           yes
    
  2. Another option is to create a shell script to execute sudo umount -a -t nfs4 (need to setup NOPASSWD in sudoers first) and add it as a "logout" script either through the GUI "System Setting -> Startup and Shutdown -> Autostart -> Add Logout Scripts..." or simply put it in the ~/.config/plasma-workspace/shutdown folder.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .