You are not logged in.

#1 2014-06-15 12:15:30

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

[SOLVED]Unmounting NFS shares before network is brought down

I'm using networkd and I have enabled the network-wait-online service, so at boot-time my NFS shares are mounted after the network becomes available. That all works perfectly.

However, it doesn't work the other way around i.e. when shutting down. The network is brought down, and then systemd attempts to unmount the shares, which obviously doesn't work.

Have I missed a step?

Last edited by tomk (2014-07-04 12:31:47)

Offline

#2 2014-06-15 14:32:17

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED]Unmounting NFS shares before network is brought down

Are the NFS mount.units actually ordered After=network-wait-online.service?  If so, I think that would be an indication that network-wait-online.service doesn't work the same way when shutting down.  That is, it doesn't delay the shutdown of the network management service until after all dependent network using services have stopped.

If that is the case, then I would call this a bug and ask on [systemd-devel] (or the IRC).

Offline

#3 2014-06-20 20:34:53

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,489

Re: [SOLVED]Unmounting NFS shares before network is brought down

I'm not using it, but reading your topic made me associate the "nfs-client.target" mentioned here: https://mailman.archlinux.org/pipermail … 26393.html

Offline

#4 2014-06-21 00:59:22

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED]Unmounting NFS shares before network is brought down

Strike0 wrote:

I'm not using it, but reading your topic made me associate the "nfs-client.target" mentioned here: https://mailman.archlinux.org/pipermail … 26393.html

I checked this out too, but it has a lot of 'Wants' that I don't really need.  Maybe I could fix it up, but I use autofs so I don't have this problem (the real autofs, not the systemd one).

%  systemctl cat nfs-client.target                                                                                                                                                              
# /usr/lib/systemd/system/nfs-client.target
[Unit]
Description=NFS client services
Before=remote-fs-pre.target
Wants=remote-fs-pre.target

# Note: we don't "Wants=rpc-statd.service" as "mount.nfs" will arrange to
# start that on demand if needed.
Wants=rpc-gssd.service rpc-svcgssd.service
Wants=nfs-blkmap.service rpc-statd-notify.service
Before=rpc-gssd.service rpc-svcgssd.service nfs-blkmap.service

[Install]
WantedBy=multi-user.target
WantedBy=remote-fs.target

Last edited by WonderWoofy (2014-06-21 01:00:04)

Offline

#5 2014-06-21 08:15:16

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,489

Re: [SOLVED]Unmounting NFS shares before network is brought down

Yes, I see. I would not want all those either unless really required, particularly the rpc ones.. Better to check out what you ask in post #2 about the ordering first.

Offline

#6 2014-07-04 12:31:25

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED]Unmounting NFS shares before network is brought down

Yeah, nfs-client.target makes no difference, and as mentioned, is unnecessary.

I'm guilty of leaving out an important detail above - I use networkd with wpa_supplicant, and the issue comes down to systemd stopping wpa_supplicant before networkd on shutdown. So i've now ordered my nfs mount units After=wpa_supplicant, and all's well.

Offline

Board footer

Powered by FluxBB