Linux gurus: How do I remotely kill a process that is causing problems?

BlvdKing

Golden Member
Jun 7, 2000
1,173
0
0
Yesterday I came home to find my display had frozen on the xscreensaver. The machine itself wasn't frozen, just the display. I used another computer on my network to telnet into my machine and then changed to root. I then started killing processes starting with xscreensaver, then gnome and enlightenment, and then finally X. When I hit enter to kill X, I lost connectivity with my machine and telnet exited. Nothing happened on my computer. Before I killed X, I tried to 'shutdown -r now' to see if I could remotely reboot my machine, but nothing happened, even though it said it was shutting down on the telnet client window. I finally had to hard reboot my machine, which I hate doing because I know that one day my file system wil not recover, and my setup is perfect now.

My question is, how can either remotely reboot my machine, or kill a process remotely (X) without freezing the machine? I would like to avoid hard reboots, which I have to do quite often.

Thanks in advance :)

 

bubba

Golden Member
Oct 10, 1999
1,589
0
0

Usually a 'kill -9 nnnn' (where nnnn is the process id) will work. If a reboot itself won't work, you may have been really frozen up.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
shutdown -r now should work from a telnet session, if not there's something else broken.

Also just do 'kill pid' first and only use 'kill -9 pid' as a last resort for something that won't exit gracefully.
 

BlvdKing

Golden Member
Jun 7, 2000
1,173
0
0
Thanks for the input. Unfortunately, when I typed shutdown -r now into my telnet session, it replied that it was going to shutdown but when I looked over at my computer, nothing was happening. Also, the telnet session was still alive after entering that command, so I think my computer ignored the command or X is keeping it from shutting down. I think the fact that after I kill X (kill -9 pid of X) the telnet session closes (I can't telnet back in) and my computer really does lock up means that X is the problem. Any other ideas?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I think the fact that after I kill X (kill -9 pid of X) the telnet session closes (I can't telnet back in) and my computer really does lock up means that X is the problem. Any other ideas?

If you kill X and your telnet session dies something else is definately wrong.
 

FUBAR

Senior member
Oct 11, 1999
618
0
0
How long did you wait before hard booting? depending on what is going on with the system it can take a while for the machine to go down. Also, your telnet session will stay active until it shuts down far enough to kill inetd or maybe even mgetty (but I think it's inetd)

If you want to check, you could issue the shutdown, then run top quicky and watch the processes disappear until you get disconnected.
 

BlvdKing

Golden Member
Jun 7, 2000
1,173
0
0
Well, it seems there is an Athlon CPU bug that affects Linux and will cause lockups if there is heavy use of the AGP bus. To fix it put this line in lilo.conf file:

append = "mem=nopentium"

I found this on the front page of HardOCP. Anyways, this seems to have fixed things for me.

Also, I was able to kill tribes 2 remotely after it locked up on me and remotely shutdown my computer just for the hell of it.

Thanks for your advise, everything seems fixed now.