You are not logged in.

#1 2021-03-15 12:33:09

shaurz
Member
Registered: 2004-02-02
Posts: 358

Wireless Service shutting down before NFS shares are unmounted

I have some NFS shares in fstab that are mounted on boot (_netdev is specified in the options).

I am using wi-fi configured with systemd-networkd and iwd.

Unfortunately it seems that 'Wireless Service' is shut down before it attempts to unmount the NFS shares, which means that shutdown always waits 1m 30s for systemd to time out.

Is there a way to force the shares to be unmounted early? I guess I might have to create systemd.mount units for each of them.

I would have thought that _netdev mounts would automatically unmount before the network is shut down.

Offline

#2 2021-03-15 12:38:35

progandy
Member
Registered: 2012-05-17
Posts: 5,196

Re: Wireless Service shutting down before NFS shares are unmounted

Try to set "x-systemd.requires=network-online.target" for your nfs mounts and enable systemd-networkd-wait-online.service.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

#3 2021-03-15 13:22:34

shaurz
Member
Registered: 2004-02-02
Posts: 358

Re: Wireless Service shutting down before NFS shares are unmounted

Thanks for the quick reply, unfortunately it didn't work. I also tried adding x-systemd.requires=iwd.service, but that did not help either.

It seems like there is a race condition. I have 3 shares, and usually 2 of them finish unmounting but one of them does not get there in time. I wonder if the unmount is returning before it has actually finished unmounting.

Does "Requires" mean that the required service must be stopped after everything that requires it?

Offline

#4 2021-03-15 13:47:39

shaurz
Member
Registered: 2004-02-02
Posts: 358

Re: Wireless Service shutting down before NFS shares are unmounted

OK I've tried creating .mount units for each mount, and added a stronger BindsTo= dependency for network-online.target and iwd.service... but that did not work either.

Offline

#5 2021-03-15 14:10:13

shaurz
Member
Registered: 2004-02-02
Posts: 358

Re: Wireless Service shutting down before NFS shares are unmounted

For illustration. For some reason, we get the Unmounted message for Data1 and Data2, but not for Data3.

https://i.imgur.com/slTsA1P.jpg

Mod Edit - Replaced oversized image with link.
CoC - Pasting pictures and code

Last edited by Slithery (2021-03-15 14:14:19)

Offline

Board footer

Powered by FluxBB