Runaway Process / Infinite Loop
(or a Background Process)
When a program gets caught in an infinite loop (the condition to end the repeat loop is never met), it uses up resources on the server and will continue to use resources until it is stopped (killed). If you're testing in a web browser, pressing the browser's stop button or closing the browser does NOT necessarily stop the process. You need to ssh/telnet into your account.
If you're running the program from the command line of an ssh/telnet session, it can usually be stopped with a cntl-C. If this doesn't work you will need to open another ssh/telnet session and stop the process from there.
The following are instructions for stopping a "run-away" program in your account on itp.nyu.edu.
After you have successfully logged into your account and get a command prompt, type:
You will get a list like:
If that doesn't give you enough information try:
To kill program_name.cgi, type:
kill 30765 (for the example above)
Then: ps -U netid if program_name.cgi is still there then type:
kill -9 30765 (for the example above)
Then repeat: ps -U netid It should be gone by then.
kill pid#/pkill program_name.cgi is the gentler way to kill a process -- tell the program to stop. Sometimes when a program is in an infinite loop it doesn't even "hear" the request to stop. kill -9 pid#/pkill -9 program_name.cgi will stop the process whether it's "listening" or not.
In general though, use kill first and only use kill -9 if the kill doesn't work.