-
Notifications
You must be signed in to change notification settings - Fork 151
Impelemented deactivate function and disconnect command. #58
base: master
Are you sure you want to change the base?
Conversation
Hi @Jonnycake, Thanks for the pull request. I just have a couple comments on the code, and then I think this is good to go. |
@@ -108,6 +109,9 @@ def autoconnect_command(args): | |||
else: | |||
assert False, "Couldn't find any schemes that are currently available." | |||
|
|||
def disconnect_command(args): | |||
subprocess.call(['dhclient', '-r', args.interface], stderr=subprocess.STDOUT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you use /sbin/dhclient
here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice not to repeat this code twice, but as there is no way to fetch the currently activated scheme, I'm ok with it.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"can you use /sbin/dhclient here too?"
Yup, I actually meant to, but my brain must not have been working yet this morning.
"It would be nice not to repeat this code twice..."
Yeah, I was thinking that myself, but like you said there's no way to get the current scheme, so if you're okay with it I am at least until if/when such a function becomes available.
Ok, so I was trying it out and I'm still not having anything. I'm not running NetworkManager or wicd. But I don't think that maybe wpa_supplicant is related in someway. When I run |
Yeah I have wpa_supplicant on my machine as well and it doesn't seem to be affecting it. What distribution are you using? Maybe there's another daemon that's mucking things up. For clarification: normally my machine runs NetworkManager, but wpa_supplicant is still used and is currently running. |
I'm on debian, what are you on? -rocky On Mon, Jan 26, 2015 at 7:33 AM, Jon Stockton [email protected]
|
Ubuntu, I'l try under debian, but I don't see that it should be any different. Run this command: |
I get: root 29 2 0 Jan05 ? 00:00:00 [netns] What do you have? -rocky On Sun, Feb 1, 2015 at 3:39 PM, Jon Stockton [email protected]
|
root 1084 1 0 Jan31 ? 00:00:00 /usr/sbin/xinetd -dontfork -pidfile /var/run/xinetd.pid -stayalive -inetd_compat -inetd_ipv6 Was going to say that it must've been the wpa_supplicant process, but that's wrong - I found it running on mine as well. Try killing and restarting the dhclient proceess after stopping network manager. See here: |
This won't do anything if NetworkManager (or another network management daemon) is running, but it works otherwise.