Make systemd stop starting unwanted wpa_supplicant service

configurationservicessystemdwpa-supplicant

I wanted to disable systemd unwanted attempts to automatically start wpa_supplicant. I thougth I could simply run a

sudo systemctl disable wpa_supplicant.service --global

and I would not be seeing a wpa_supplicant in ps -ef output anymore. Anyway this did not work.
How can I make it work?

My problem at hand might be best described by the output of

$>systemctl status wpa_supplicant*
● wpa_supplicant.service - WPA supplicant
   Loaded: loaded (/usr/lib/systemd/system/wpa_supplicant.service; disabled; vendor preset: disabled)
   Active: active (running) since Sun 2016-08-28 20:57:37 CEST; 14min ago

where as you can see the disabled service is anyway loaded and active, thanks to systemd completely helping me do the simpletest thing 😉

Update
I seem to have had some luck by brutely removing these files:

wpa_supplicant-nl80211@.service
wpa_supplicant.service
wpa_supplicant@.service
wpa_supplicant-wired@.service

from /usr/lib/systemd/system folder. Guess what? After restart wpa is finally not started by systemd anymore. It strikes me though there must have been a more peaceful / conciliatory way to get systemd to have the service not being started.

Best Answer

I ran into the same issue as yours. After some digging, I found a folder called:

/usr/share/dbus-1/system-services/fi.w1.wpa_supplicant1.service

This is file is used to allow the service to be activated by d-bus. d-bus can activate the service even if it is disabled. I confirmed that this was happening by re-naming the file, and then rebooting. I saw that at this point wpa_supplicant had not been started! To chase the issue down further would required finding out what program is activating wpa_supplicant via d-bus. I have not done this as masking the unit file works fine for my purposes.