I want to stop wpa_supplicant on ubuntu

15.5k Views Asked by At

I want to stop wpa_supplicant on ubuntu 14.04.

I did follow but the wpa_supplicant restarted by someone.

$ ps aux | grep wpa

root      4947  0.0  0.0  30628  4968 ?        Ss   09:41   0:00 /sbin/wpa_supplicant -B -P /run/sendsigs.omit.d/wpasupplicant.pid -u -s -O /var/run/wpa_supplicant

$ sudo kill 4947

$ ps aux | grep wpa

root      5458  0.0  0.0  30628  4996 ?        Ss   09:55   0:00 /sbin/wpa_supplicant -B -P /run/sendsigs.omit.d/wpasupplicant.pid -u -s -O /var/run/wpa_supplicant 

I want to know who restart the supplicant and stop wpa_supplicant abidingly. Because I am trying to test another version wpa_supplicant.

6

There are 6 best solutions below

0
On BEST ANSWER

The brute-force way is to break wpa_supplicant by renaming it. Whatever tries to start it won't find it anymore.

$ which wpa_supplicant 
/sbin/wpa_supplicant

$ sudo mv /sbin/wpa_supplicant /sbin/wpa_supplicant_org

$ sudo killall wpa_supplicant

And I got a result I wanted that the wpa_supplicant cannot restart anymore.

This method has some caveats:

  • An update might fix the package again.
  • You can't manually start wpa_supplicant when you use this method.
3
On
sudo pkill wpa_supplicant

usually does the trick for me. Are you looking for something else?

0
On

On Ubuntu 20.04

systemctl stop wpa_supplicant
systemctl disable wpa_supplicant

The second command will stop it from automatically starting.

0
On

In my case, I had a service that was launching it. I did a grep inside systemd config directory

cd /etc/systemd/system 
grep -ri wpa 

That showed me the name of the service that is starting this.

Used the following command to stop it

sudo systemctl stop <service-name>

If you would like to permanently disable it, remove the "WantedBy" line in the service file.

0
On

wpa_supplicant provides the WPA security. Any network manager (e.g. Network Manager,netctl etc) that deals with wifi network would use wpa_supplicant. So whenever the network manager starts it would start wpa supplicant. If you want to permanently disable it (because may be you dont use wifi or secure wifi) then you can mask it.

 sudo systemctl mask wpa_supplicant.service

then stop it:

sudo systemctl stop wpa_supplicant.service

NOTE:Masking basically creates a symlink to /dev/null, so even if some service tries to start it it won't start. This would disable it until you manually unmask it again.

sudo systemctl unmask wpa_supplicant.service
0
On

The clean way to shut down wpa_supplicant is

wpa_cli terminate

Sometimes you need to specify the interface as in

wpa_cli terminate -i wlan0