Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C (http://www.programmingforums.org/forum60.html)
-   -   server-infinite loop (http://www.programmingforums.org/showthread.php?t=11419)

programmingnoob Sep 28th, 2006 7:36 AM

server-infinite loop
 
okay i accidently set an infinite loop inside my server, in other words i coded it so that the server wouldnt close until that particular while loop ends, and the prob is ... it;s an infinite while loop!
now i really need to exit the server, what step do i need to take?? i think the server code is still running

bivhitscar Sep 28th, 2006 7:53 AM

Press and hold the power button. :P

Why do I get the feeling you do not have physical access to the server? Oh dear...

programmingnoob Sep 28th, 2006 7:58 AM

Quote:

Originally Posted by bivhitscar (Post 115177)
Press and hold the power button. :P

Why do I get the feeling you do not have physical access to the server? Oh dear...

coz i dont! the terminal on which the server is running is located in computer lab, and I am sitting here at home! I just used Putty to access the terminal, but now what do I do to make sure the server stops running! (server is just a program)

bivhitscar Sep 28th, 2006 8:12 AM

Umm, I assume you are running a flavour of Unix? I'm a bit flaky on my commands, but assuming you can get access to a command line, can you just kill the process?

programmingnoob Sep 28th, 2006 8:25 AM

Quote:

Originally Posted by bivhitscar (Post 115182)
Umm, I assume you are running a flavour of Unix? I'm a bit flaky on my commands, but assuming you can get access to a command line, can you just kill the process?

how do i kill it?
i tried logging out of Putty and then going back again, that did not help

bivhitscar Sep 28th, 2006 8:32 AM

If you can get to a command line, read this on how to kill a process - http://www.ss64.com/bash/kill.html


[EDIT]

You may want to read this one too, to find out which process to kill - http://www.ss64.com/bash/ps.html

programmingnoob Sep 28th, 2006 8:35 AM

Quote:

Originally Posted by bivhitscar (Post 115185)
If you can get to a command line, read this on how to kill a process - http://www.ss64.com/bash/kill.html


[EDIT]

You may want to read this one too, to find out which process to kill - http://www.ss64.com/bash/ps.html

when i do the ps thing, it says "ERROR: Garbage Options"
I have no idea what that means!

bivhitscar Sep 28th, 2006 8:42 AM

Oh my, I'm not sure if there's much more I can suggest, I'm not very experienced with linux unfortunately.

Eoin Sep 28th, 2006 8:50 AM

Try running the top command. If you apps has an infinite loop it's probably hogging the cpu and so should appear in that list.

Once you get its PID simply press q to exit the list and run kill PID as bivhitscar suggested.

programmingnoob Sep 28th, 2006 8:56 AM

Quote:

Originally Posted by Eoin (Post 115188)
Try running the top command. If you apps has an infinite loop it's probably hogging the cpu and so should appear in that list.

Once you get its PID simply press q to exit the list and run kill PID as bivhitscar suggested.

when I tried to kill them, it said "the operation not permitted" !


All times are GMT -5. The time now is 1:14 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC