Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stopping script execution

Status
Not open for further replies.

martinasv

Technical User
Feb 12, 2006
24
HR
Hello guys and gals!

I have a perl script which captures ARP packets on the network.

Right now I'm starting it from command-line and stopping it with Ctrl-C.

But, I'd like to start it and stop it from perl/CGI stript (HTML page, Start and Stop buttons).

I know I could start it using backticks or system(), but how do I stop it?
 
There has to be a more graceful way?

Pass a capture/nocapture||terminiate signal to the process, rather than kill by PID ($$)

Just a thought

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Hi

Of course Paul, I meant so. While the default signal sent by the [tt]kill[/tt] command is SIGTERM ( 15 ), I did not specified it, but of course, sending the SIGKILL ( 9 ) should be the last solution for misbehaving programs.

Feherke.
 
Yeah, that's a pretty common way to manage services. Check /var/run/*.pid on most *nix systems.

- Andrew
Text::Highlight - A language-neutral syntax highlighting module in Perl
also on SourceForge including demo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top