Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 544272 - net-wireless/wpa_supplicant: systemd units have incomplete dependencies causing early termination on shutdown
Summary: net-wireless/wpa_supplicant: systemd units have incomplete dependencies causi...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Rick Farina (Zero_Chaos)
Depends on:
Reported: 2015-03-23 21:56 UTC by walt
Modified: 2018-03-13 12:09 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---

Patch against hostap git master (,2.98 KB, patch)
2015-08-12 01:50 UTC, Mike Gilbert
Details | Diff
Patch with typos fixed (,2.98 KB, patch)
2015-08-12 01:52 UTC, Mike Gilbert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description walt 2015-03-23 21:56:36 UTC
When there are NFS shares mounted over a wireless network, systemd shuts the wireless interface down *before* unmounting the NFS shares, causing the umount command to hang and thus the machine won't shut down.

Reproducible: Always

Steps to Reproduce:
1. Mount an NFS share on a wireless machine
2. systemctl poweroff (or reboot)

Actual Results:  
After tearing down wlan0, systemd spawns a process to wait for the umount command to succeed, but it never succeeds because the NFS server can't be reached over the wireless network.
Comment 1 Dan Goodliffe 2015-08-08 03:20:22 UTC
I've witnessed this too... seems to cause similar issues with LDAP setups too.
Despite my best efforts, I can't seem to add anything to the units to prevent this.
Comment 2 walt 2015-08-08 15:08:50 UTC
BTW, still happens with systemd-224-r1, nothing specific about 219.  Someone at Redhat *must* have seen this before, the scenario is not that uncommon.

Been awhile since I looked at the Fedora unit files.  Maybe a clue there...
Comment 3 Mike Gilbert gentoo-dev 2015-08-08 15:35:12 UTC
What software are you all using to manage your network/wifi connections?
Comment 4 Dan Goodliffe 2015-08-08 15:37:27 UTC
NetworkManager for me.
Comment 5 walt 2015-08-08 16:17:35 UTC
I have wpa_supplicant@wlan0, systemd-networkd, systemd-networkd-wait-online services enabled (not networkmanager).
Comment 6 Mike Gilbert gentoo-dev 2015-08-08 17:40:13 UTC
(In reply to walt from comment #5)
> I have wpa_supplicant@wlan0, systemd-networkd, systemd-networkd-wait-online
> services enabled (not networkmanager).

In your case, I think it is because wpa_supplicant@wlan0.service is not ordered before

Can you try adding the following to the [Unit] section of /usr/lib/systemd/wpa_supplicant@.service?
Comment 7 Mike Gilbert gentoo-dev 2015-08-08 17:42:13 UTC
Also, please try adding the NFS share to fstab if it is not there already; this will cause systemd to generate a mount unit for it with the necessary dependencies.
Comment 8 walt 2015-08-08 20:44:34 UTC
Great work, Mike :)  Adding the fixed the problem.

A thousand thanks for this bugfix and all the hard work you do for gentoo.
Comment 9 Mike Gilbert gentoo-dev 2015-08-08 20:59:11 UTC
(In reply to Dan Goodliffe from comment #4)
> NetworkManager for me.

Would you mind filing a separate bug? I would like to close this one out once I fix the wpa_supplicant unit(s).
Comment 10 Dan Goodliffe 2015-08-08 22:07:43 UTC
Will do... thought it was the same problem because it only started when I switched to systemd... no matter. Thanks.
Comment 11 Mike Gilbert gentoo-dev 2015-08-12 01:50:07 UTC
Created attachment 408832 [details, diff]
Patch against hostap git master

Here is my proposed solution.
Comment 12 Mike Gilbert gentoo-dev 2015-08-12 01:52:40 UTC
Created attachment 408834 [details, diff]
Patch with typos fixed
Comment 13 Mike Gilbert gentoo-dev 2015-08-12 14:46:16 UTC
Sent a patch upstream (see URL).
Comment 14 Mike Gilbert gentoo-dev 2015-08-15 00:05:53 UTC
This has been applied upstream.

gurligebis: I see you seem to be maintaining some mini patchsets. Can you backport this or tell me how you would like it to be done?
Comment 15 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2015-08-15 14:58:59 UTC
Haven't had time to get my dev machine git-ified yet.

Just put the patch inside the files directory, and epatch it in, in an bumped -r release :)