LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Wireless Networking (https://www.linuxquestions.org/questions/linux-wireless-networking-41/)
-   -   How do I kill wpa_supplicant ? (https://www.linuxquestions.org/questions/linux-wireless-networking-41/how-do-i-kill-wpa_supplicant-498521/)

FlyByWire 11-04-2006 05:48 AM

How do I kill wpa_supplicant ?
 
Hi,

I'm a new Linux user and really liking it, I'm converted but need some help from you more experienced people out there.

I'm running Susse 10 and I need to stop/kill wpa_supplicant.
How do i do that?

I've tried "kill wpa_supplicant" and nothing.
I've tried "killall wpa_supplicant" and nothing.

Cheers,

FlyByWire

jschiwal 11-04-2006 06:06 AM

wpa_supplicant is running in the background as root. One thing you can do is run wpa_cli and shut it down there:
Code:

> sudo /usr/sbin/wpa_cli -p /var/run/wpa_supplicant -i wlan0
wpa_cli v0.4.8

....

Interactive mode

> terminate
OK
> 'PING' command timed out.
Connection to wpa_supplicant lost - trying to reconnect
quit

Another thing you can do is use kill to terminate it:
sudo kill -s SIGQUIT $(cat /var/run/wpa_supplicant/wlan0.pid)

If you want to shut down the wireless device:
sudo /sbin/rcnetwork stop

FlyByWire 11-04-2006 12:18 PM

jschiwal,

Thank you for the reply, before I do anything can you just clarify the command as I'm not sure what the "/var/run/wpa_supplicant -i wlan0 wpa_cli v0.4.8" is for?

To kill it do I issue the command:

/usr/sbin/wpa_cli -p

Is this correct or do I also type this complete line:

var/run/wpa_supplicant -i wlan0 wpa_cli v0.4.8

I understand the last one with kill -s.

Unfortunately I'm so new to all of this it needs to be spoon feed at the moment until I get my head around Linux.

All the best,

FlyByWire

P.S. Is it possible to edit a script of some sort so that it doesn't start up in the first place as the machine boots? If so how do I do it?

jschiwal 11-07-2006 12:25 AM

You missed the '-p' in your response.

The -p is followed by the working path in /var/run. After the -i is the interface to control.

If you just remember the PI symbol in your mind you will probably remember. And thanks to auto-competion, you don't need to type in all of /var/run/wpa_supplicant/.

If you want to disable the device, you can simply run "sudo /sbin/rcnetwork stop wlan0". If you want to connect to an AP that doesn't use WPA, the documentation in /usr/share/doc/packages/wpa_supplicant/ has examples where you have can have more than one section of wpa_supplicant. One section for each network. I'm not sure how you make the changes in SuSE however. You might want to use the network toolbar applet instead ( That is mentioned in the yast2 -> networking configuration.

If you simply don't want to use wpa at all, then reconfigure your device.

FlyByWire 11-07-2006 06:08 PM

No Luck with killing wpa_supplicant
 
Hi,

Sorry to say, none of the above works :-(

This is what was displayed back to me when I typed in exactlty what you wrote.
I am very, very new to Linux so you will have to explain in layman terms what I'm doing wrong and what I need to do.

RESULTS:

var/run/wpa_supplicant -i wlan0 wpa_cli -p
did not work, got lots of errors, too many to list. Gave help file for correct usage.... I have no idea :-(


result
------
linuxPC123:~ # kill -s SIGQUIT $(cat /var/run/wpa_supplicant/wlan0.pid)
cat: /var/run/wpa_supplicant/wlan0.pid: No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
linuxPC123:~ #




These are my settings
---------------------

linuxPC123:~ # ifconfig
ath0 Link encap:Ethernet HWaddr 00:09:5B:84:4E:C8
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:237 errors:0 dropped:0 overruns:0 frame:0
TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:28083 (27.4 Kb) TX bytes:15218 (14.8 Kb)

ath1 Link encap:UNSPEC HWaddr 06-09-5B-84-4E-C8-00-00-00-00-00-00-00-00-00 -00
UP BROADCAST RUNNING MTU:1500 Metric:1
RX packets:165507 errors:0 dropped:0 overruns:0 frame:0
TX packets:24475 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:29274935 (27.9 Mb) TX bytes:1664300 (1.5 Mb)

eth0 Link encap:Ethernet HWaddr 00:13:20:35:5E:B3
inet addr:192.168.0.55 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::213:20ff:fe35:5eb3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:6994 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:508611 (496.6 Kb)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:830 errors:0 dropped:0 overruns:0 frame:0
TX packets:830 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:64948 (63.4 Kb) TX bytes:64948 (63.4 Kb)

wifi0 Link encap:UNSPEC HWaddr 00-09-5B-84-4E-C8-00-00-00-00-00-00-00-00-00 -00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:143955 errors:0 dropped:119249 overruns:0 frame:45105
TX packets:26363 errors:18 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:199
RX bytes:4551281 (4.3 Mb) TX bytes:1871137 (1.7 Mb)
Interrupt:193 Memory:f8ca0000-f8cb0000


linuxPC123:~ # iwconfig
lo no wireless extensions.

wifi0 no wireless extensions.

ath0 IEEE 802.11g ESSID:"TheDude" Nickname:"linuxPC123"
Mode:Managed Frequency:2.452 GHz Access Point: Not-Associated
Bit Rate:0 kb/s Tx-Power:13 dBm Sensitivity=0/3
Retry:off RTS thr:off Fragment thr:off
Encryption key:07E6-941B-85 Security mode:open
Power Management:off
Link Quality=0/94 Signal level=-95 dBm Noise level=-95 dBm
Rx invalid nwid:47609 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

eth0 no wireless extensions.

sit0 no wireless extensions.

ath1 IEEE 802.11g ESSID:""
Mode:Monitor Frequency:2.437 GHz Access Point: 06:19:5B:84:4E:C8
Bit Rate:0 kb/s Tx-Power:13 dBm Sensitivity=0/3
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=0/94 Signal level=-95 dBm Noise level=-95 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0


Thanks in advance,

FBW

FlyByWire 11-09-2006 06:04 AM

Here are other results when I try to stop wpa_supplicant:

linuxPC123:/etc/init.d # wpa_supplicant stop

wpa_supplicant v0.4.8
Copyright (c) 2003-2006, Jouni Malinen <jkmaline@cc.hut.fi> and contributors

This program is free software. You can distribute it and/or modify it
under the terms of the GNU General Public License version 2.

Alternatively, this software may be distributed under the terms of the
BSD license. See README and COPYING for more details.

This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.openssl.org/)

usage:
wpa_supplicant [-BddehLqqvwW] [-P<pid file>] [-g<global ctrl>] \
-i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-p<driver_param>] \
[-N -i<ifname> -c<conf> [-C<ctrl>] [-D<driver>] [-p<driver_param>] ...]

drivers:
hostap = Host AP driver (Intersil Prism2/2.5/3)
prism54 = Prism54.org driver (Intersil Prism GT/Duette/Indigo)
madwifi = MADWIFI 802.11 support (Atheros, etc.)
atmel = ATMEL AT76C5XXx (USB, PCMCIA)
wext = Linux wireless extensions (generic)
ndiswrapper = Linux ndiswrapper
ipw = Intel ipw2100/2200 driver
wired = wpa_supplicant wired Ethernet driver
options:
-B = run daemon in the background
-c = Configuration file
-C = ctrl_interface parameter (only used if -c is not)
-i = interface name
-d = increase debugging verbosity (-dd even more)
-D = driver name
-g = global ctrl_interface
-K = include keys (passwords, etc.) in debug output
-t = include timestamp in debug messages
-h = show this help text
-L = show license (GPL and BSD)
-p = driver parameters
-P = PID file
-q = decrease debugging verbosity (-qq even less)
-v = show version
-w = wait for interface to be added, if needed
-W = wait for a control interface monitor before starting
-N = start describing new interface
example:
wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf

linuxPC123:/etc/init.d # /etc/init.d/wpa_supplicant stop
bash: /etc/init.d/wpa_supplicant: No such file or directory
linuxPC123:/etc/init.d #


Could someone please help me with this, I need to know how to stop the daemon.

All the best,

FBW

PTrenholme 11-09-2006 07:03 AM

In the "kill" command, all the $(...) stuff was just to find the pid (process identification) of the wpa_supplicant you're running.

As an alternative, try (logged in as root) kill `pidof wpa_supplicant`

Note the use of the "backquote" in the above command. It tells the "shell" to replace what's inside the backquoted expression by the result of evaluating the expression. This is what the $(...) does, too. I prefer the backquote form since its easier to type . . .

Note that wpa_supplicant is required by most network connection software packages if WPA or WPA2 protection is implemented by the server to which you wish to connect, so disabling it will prevent access to such servers.

If you really want to not have it run, remove it from the list of services to be started when you boot your system. (On my Fedora Core system, the system-config-services command is used to specify boot services.)

FlyByWire 11-09-2006 11:50 AM

Hi,

Thank you for the reply but this did not work either :-(

I typed in exactly this: kill `pidof wpa_supplicant` and it came back with an error.
Should "pidof" be a process number or something along those lines?

Thanx

FBW

Fluxx 11-09-2006 12:18 PM

In my system (Slackware 11)

Code:

killall wpa_supplicant
works fine.

If needed you can add

Code:

rm /var/run/wpa_supplicant/*
Only my way to kill wpa_supplicant ...

Fluxx.

Chromezero 11-09-2006 12:41 PM

If you installed wpa_cli during the build, you can just just use this...
Code:

wpa_cli terminate

FlyByWire 11-09-2006 04:47 PM

Sorry, none of the above work, these are the results:

linuxPC123:~ # wpa_cli terminate
Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory


linuxPC123:~ # killall wpa_supplicant
wpa_supplicant: no process killed
linuxPC123:~ #


This is a real problem for me, I just cannot stop this damn process !!!!!

HELP !!

FBW

Chromezero 11-09-2006 07:07 PM

Ok, it appears you don't have wpa_cli installed. Which is likely why you get an error when you try to run a wpa_cli command. When you create the ".config" file before you build wpa_supplicant, you need to make sure you have the following line...
Code:

CONFIG_CTRL_IFACE=y
Then, wpa_cli should work as expected.

PTrenholme 11-10-2006 10:11 AM

Quote:

Originally Posted by FlyByWire
Hi,

Thank you for the reply but this did not work either :-(

I typed in exactly this: kill `pidof wpa_supplicant` and it came back with an error.
Should "pidof" be a process number or something along those lines?

Thanx

FBW

Yes and no, On a Fedora system, the pidof command returns the process id(s) of the argument.

If you don't have the pidof command available, you can usually find the pid(s) of a process by, for example,
Code:

# ps -e | grep wpa
This should display the pids of any processes with "wpa" in the process name.

If that returns, say, 12345, then a kill 12345 should kill the process. Running the ps command a second time should confirm (by returning nothing) that the process was terminated. (If it return a different pid, see below.)

You should consider that other wireless network access programs (e.g., NetworkManager) may require that wpa_supplicant be running. And, it they find that it's not running, they may automatically start it. If this is the case, you may need to disable all your network access programs (or, at least, the ones that are starting wpa_supplicant) to prevent it from running.

If you have the pstree command, it should show you if wpa_supplicant has been started as a child of some other process. (Although another process may start it as an independent process rather than as a child.)

I'm still puzzled as to why you want to stop wpa_supplicant. Even if you don't need wpa protected network access, having it running does no harm, :scratch:


All times are GMT -5. The time now is 02:34 AM.