Aloso
Aloso

Reputation: 5447

Terminate running perl script started with CGI

I am creating a Perl script that creates a Net::WebSocket::Server on port 3000. Now I had the (not so brilliant) idea to start the script in the browser via CGI, so it runs in the background and can't be stopped. However, I have to restart the script whenever I modify it.

Is it possible to stop a CGI script in an endless loop, except by restarting the computer?

Upvotes: 0

Views: 381

Answers (1)

simbabque
simbabque

Reputation: 54381

You didn't say what operating system you are on, so we cannot give you specific advice on how to find and kill the process. But you can always restart the web server application. CGI scripts are children of the server process (probably an Apache) that starts them. If you simply restart the Apache server, they should all be terminated.

Please don't put code that is supposed to run persistently in your cgi-bin directory. That's a bad idea, as you discovered.

Upvotes: 1

Related Questions