Aramis
May 18th, 2006, 04:33 PM
Hi y'all,
As you can see everything is in the title. I would like to know how I can stop processes such as TCPReplay, TCPDump, Snort and so on programmatically. Typi cally, you have to kill these processes by either pressing CTRL+C in their respective terminals, or using the "sudo kill PID" command. The reason why I would like to control when to stop such task is because I have developpe a piece of software for my PhD that is able to start various tasks around a network and report back to a Master Application. TCPReplay and the like are typically tasks that I would start at the beginning of an experiment and stop before moving on to the next phase of the experiment.
Of course, my current solution, at the moment, is to start 2 deamons:
* one would start, say, TCPReplay
* one would search for the PID and kill the application accordingly
Not the best of solution I admit, thus this post :mrgreen:
Help much appreciated
Ar@mi$
PS: I went throught the man pages for TCPReplay apparently it supports 2 signals. These do not "stop" the process as such but "pause/restart" it rather. I can't find how to send these signals :'( and I believe these do not fit my requirements.
As you can see everything is in the title. I would like to know how I can stop processes such as TCPReplay, TCPDump, Snort and so on programmatically. Typi cally, you have to kill these processes by either pressing CTRL+C in their respective terminals, or using the "sudo kill PID" command. The reason why I would like to control when to stop such task is because I have developpe a piece of software for my PhD that is able to start various tasks around a network and report back to a Master Application. TCPReplay and the like are typically tasks that I would start at the beginning of an experiment and stop before moving on to the next phase of the experiment.
Of course, my current solution, at the moment, is to start 2 deamons:
* one would start, say, TCPReplay
* one would search for the PID and kill the application accordingly
Not the best of solution I admit, thus this post :mrgreen:
Help much appreciated
Ar@mi$
PS: I went throught the man pages for TCPReplay apparently it supports 2 signals. These do not "stop" the process as such but "pause/restart" it rather. I can't find how to send these signals :'( and I believe these do not fit my requirements.