You are not logged in.

#1 2015-10-21 04:00:05

plattfot
Member
Registered: 2012-09-15
Posts: 16

[SOLVED]Issue with netctl-ifplugd and nfs mounts, hangs on shutdown.

Hi,
I recently switched to using netctl-ifplugd on my laptop (was using netctl before) but almost everytime I shutdown, my laptop hangs. I tracked it down to systemd shutting down netctl-ifplugd before unmounting the nfs mounts and thus kills the network and nfs times out. However when using netctl it shuts down fine. But then I need to manually reconnect my ethernet connection if I undock and dock my laptop.

I've been trying to find a neat solution for this for a while. Found this thread
https://bbs.archlinux.org/viewtopic.php … 4#p1539504
which suggest having a script that unmounts the nfs mounts, but I would rather fix the dependencies so that systemd does not kill the network before unmounting the nfs mounts.

Has anyone any idea on how to fix this? Also what's the best way of debugging systemd's dependency graph? Using systemctl list-dependencies works pretty good but that seems to stop after few levels.

Things I have tried:
- Add Wants=network.target to the netctl-ifplugd@.service file
- Copied the auto generated automount unit files and added dependencies suggested by this thread  https://bbs.archlinux.org/viewtopic.php … 0#p1260240

Here's my nfs entries in fstab.

fafner:/srv/nfs4/Valhalla			/media/Valhalla nfs4		auto,x-systemd.automount,x-systemd.device-timeout=10,rsize=32768,wsize=32768,_netdev,timeo=10	0 0
fafner:/srv/nfs4/Hel				/media/Hel 	nfs4		auto,x-systemd.automount,x-systemd.device-timeout=10,rsize=32768,wsize=32768,_netdev,timeo=10	0 0

For now I rolled back to using netctl and manually reconnect when I need to, but it would be great to get ifplugd going.

Last edited by plattfot (2015-10-22 04:44:39)

Offline

#2 2015-10-21 18:54:26

branch
Member
Registered: 2014-03-16
Posts: 209

Re: [SOLVED]Issue with netctl-ifplugd and nfs mounts, hangs on shutdown.

Note that "Wants" does not impose any ordering requirement. Use "Before" or "After" for ordering requirements.

I would probably try something like (in netctl-ifplugd@.service):

Wants=remote-fs-pre.target
Before=remote-fs-pre.target

See the systemd.special man page for documentation of the remote-fs-pre target.

Offline

#3 2015-10-22 04:43:39

plattfot
Member
Registered: 2012-09-15
Posts: 16

Re: [SOLVED]Issue with netctl-ifplugd and nfs mounts, hangs on shutdown.

Thanks, that worked like a charm!

For future reference what I did was

systemctl edit netctl-ifplugd@.service

then added

[Unit]
Wants=remote-fs-pre.target
Before=remote-fs-pre.target

After that my laptop shuts down nice and quick.
Thanks again for your help, been scratching my head for awhile now.
Marking this thread as solved.

Offline

Board footer

Powered by FluxBB