Urgent assistance needed!

software development


Hi all,

I’ve written a script to pull links out of my own site to produce a sitemap. Each page i have in my site, i’ve created a comment tag so that i can set in each page the settings i want to have for a particular page.

The problem is, I accidentally created a recursive loop whilst trying to get it to loop over the array of links in the site.

I’ve stopped the page loading and also deleted the file fromt he server, but 5 mins later i’m still getting curl requests hitting the server and i’m worried it’s not going to stop…

Is there a way I can stop the process myself via ssh? - I don’t want it to cause any issues, although the server is still responding normally.


web design, development & seo by DigitalVibe



Log into the shell via ssh, and type “top”, followed by the enter key, at the command line prompt.

This will run the “top” program, and from there you can kill any process you see running.

for details on the use of top. run “man top”.

Essentially, you will want to use top to display the process id (PID) of the process in question, and then use the “k” command in TOP TO “KILL” it. Hitting “k” in top will prompt for the user id of the process to kill. :wink:

While it is great you are concerned about the general state of the server, I wouldn’t worry about it too much initially; the DH “procwatch” process-killer should shut it down if it gets out of hand. :wink:



Thank you kindly sir :slight_smile:

Now for my next question… the one which will stop the problem happening again!

New thread created with slightly less panic in the subject, hehe.



web design, development & seo by DigitalVibe


OMG! A thread entitled “URGENT ASSISTANCE NEEDED” where the thread title is actually accurate! This is unprecedented!

Hey Karl, glad you rlparker helped get things sorted for you. Runaway recursion is pretty scary at times.

I remember when I was coding in a fault-tolerant distributed system. I had just developed what I thought was a nice little “shutdown server” query I could send that would help with system maintenance and such. Then I sent it to the main query distributer rather than an individual server. As it turned out, this meant that when my query shut the server down, the distributer detected this as a failure and sent my query to another server for processing. Needless to say, this eventually shut down our entire processing farm. Very embarrassing.

Interestingly, the messaging system was guaranteed delivery, so even when we shut down the distributor, my query was reconstituted from persistent storage and shut down every server as they came back up. We eventually managed to delete the message in the database itself and restart the entire farm.

What are [color=#CC0000]50DISK50[/color], [color=#CC0000]3DOM50[/color], and [color=#CC0000]1IP1DOM50[/color]?
More Dreamhost coupons


Ouch! That’s pretty impressive.

I used to code a MUD (text based online game - “walk left”…“you see a tree” etc. You get the idea).

I managed to write a recursive loop there that infinitely cloned an NPC (computer enemy) when someone entered the room:

  1. Code released
  2. Time passes by, no problems, I log off.
  3. Player enters room
  4. Infinity NPCs cloned…
  5. Player died
  6. Memory got full
  7. Server crashed
  8. Server was rebooted…
  9. Admins say “Everything seems to work, but no idea what the problem was…”
  10. Player walks into the room
  11. … repeat steps 5 to 10.

Eventually the problem was found… I’d taken a few days off, so didn’t know about the problems.

I got a slapped wrist, and learned never to make the same mistake again!

Incidentally the only reason it happened tonight was because the array doesn’t seem to be updating as i wanted :frowning:

I’m still stuck on it if anyone can help over at my other thread.


web design, development & seo by DigitalVibe


Wow. That is impressive. You managed to write a loop that disobeys the MAX_EXECUTION_TIME directive. Bravo. :slight_smile:

Visit me, please…