This forum has been archived. All content is frozen. Please use KDE Discuss instead.

(Solved) autofs and shutdown delays on wifi

Tags: None
(comma "," separated)
Raxker
Registered Member
Posts
7
Karma
0
I just want to share this solution so hopefully someone else benefits from it.

I am using autofs to mount Samba shares (this is much fasters than using smb:// in dolphin.

On Shutdown the "Remote Network" sits there for ages waiting for a timeout and delays the reboot/shutdown.

Even after a manual shutdown of autofs, df -h still shows the samba shares. During shutdown the network get disconnected first because its mounted by Network Manager in KDE Plasma by the user and disconnect as soon as plasma logs you out and before the shutdown.

On shutdown the samba mounts can not be cleanly unmounted (because of no more network) and have to wait for the timeout. annoying.

I found a simple solution: I added ExecStop=umount -t cifs -af to /lib/systemd/system/autofs.service

Code: Select all
[Unit]
Description=Automounts filesystems on demand
After=network.target ypbind.service sssd.service network-online.target remote-fs.target
Wants=network-online.target nfs-client.target
Documentation=man:autofs(8)

[Service]
Type=forking
PIDFile=/run/autofs.pid
EnvironmentFile=-/etc/default/autofs
ExecStart=/usr/sbin/automount $OPTIONS --pid-file /var/run/autofs.pid
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=umount -t cifs -af
TimeoutSec=1

[Install]
WantedBy=multi-user.target


I hope that help
OsZ
Registered Member
Posts
23
Karma
0
OS
Thx - very helpful - use it for my automounted nfs shares


OsZ, proud to be a member of KDE forums since 2008-Oct.


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]