4

This is killing me. I've been at this all day and am stuck.

My goal is to run airodump-ng for 10 seconds or so, then kill the process so that the csv file that's generated stops getting constantly updated.

I have tried many implementations with no luck for a variety of reasons. Here's the most basic attempt:

command  = "airodump-ng -w airodump mon0"
airodump = subprocess.Popen([command],stdout=subprocess.PIPE,shell=True)
time.sleep(10)
airodump.terminate()
airodump.kill()
airodump.wait()
#trying to run a command like "kill <pid>" does not work either. 

If I don't sleep there, the process is interestingly never created. Since I do, the process appears on the screen and never ends. From what I've gathered searching around, I may be dealing with a full pipe buffer. I'm not sure what the implication of that is? Does this mean this one process has just taken over everything? Are there any other problems with this? What is it about airodump that won't let me just delete its Popen object and/or kill the process like usual? (in case you're unfamiliar with airodump, it is very similar behaviorally to 'top')

Garrett Hyde
  • 5,409
  • 8
  • 49
  • 55
ojef
  • 107
  • 1
  • 2
  • 9
  • I know this doesn't answer your question but `kill -9 ` force kills the process. – pogo Oct 23 '12 at 04:25
  • If kill -9 doesn't work, what about trying to CTRL_C airodump? That's how I exit it when I use it in a shell, maybe it's possible to send that same signal to the subprocess? – Protagonist Oct 24 '12 at 20:25

1 Answers1

0

On Linux, the following solution should help: How to terminate a python subprocess launched with shell=True

Are you on windows?

Community
  • 1
  • 1