Jump to content

How to kill X remotely?


Recommended Posts

Ok.. I guess this could be put in both software and this section, but this is a more advanced topic, so here goes.

 

Sometimes in Mandrake 9.1, XFree just hang.. well.. not exactly hang, mouse still works but keyboard and screen just freeze. I think this is the combination with NForce2 MB and NVidia's own driver for GeForce4 (weird hunh?). I think the software combination of the freeze consist of going back and forth on script heavy homepages in mozilla while listening to mp3 with xmms with setiathome running 100%. But that's not the problem.

 

You see, I can ssh from my other computer into the frozen computer, so the computer is not frozen, just X. Looking at top, it shows that X takes the majority of cpu usage (80-90%) while the rest is less than 10%. I tried to kill X by typing

kill -KILL (pid)

Well, it works.. sorta.. X is dead, the thing is that going to the first computer (via kvm switch), the screen becomes garbled and the keyboard still freeze, as in hardware wise, X is still running. The only way to solve the problem is either pressing the reset button or ssh from the other computer and use the "reboot" command.

 

So my question is.. is there a possible way to kill X remotely and safely? I just want the "frozen" computer to go back to terminal with keyboard and screen running smoothly.

 

Thanks in advance.

Link to comment
Share on other sites

W/O too much thinking and w/o testing I would suggest (as root):

 

~# killall -g X

 

or, maybe:

 

~# killall -KILL -g X

 

If the above doesn't work (I'm sure it will), I suggest something more radical:

 

~# kill -9 $(ps aux | awk '$1 ~ /USER_NAME_HERE/ {print $2}')

Link to comment
Share on other sites

edit your XF86Config-4 file add:

Option "AllowDeactivateGrabs" "true"

to you server flags section like so:

Section "ServerFlags"

   #DontZap # disable <Crtl><Alt><BS> (server abort)

   #DontZoom # disable <Crtl><Alt><KP_+>/<KP_-> (resolution switching)

   AllowMouseOpenFail # allows the server to start up even if the mouse doesn't work

   Option "AllowDeactivateGrabs" "true"

EndSection

 

AllowDeactivateGrabs allows deactivating any active grab with the key sequence Ctrl+Alt+Keypad-Divide

 

this can sometimes get you out of a jam when an application freezes.

works for me.

 

And if you have a remote computer webmin allows you to do all sorts of stuff to running processes.

Link to comment
Share on other sites

Just an update for my freezing X condition. Anyway, I still don't have solution of how to get my console and screen back but at least now I can get the keyboard control back. All I have to do is type init 5 then init 3 as root from the remote computer. The screen is still squeezed like crazy, but at least I can get my keyboard control back.. So I can type startx and it will restart XFree.

 

However, if I press ctrl-alt-F1 or ctrl-alt-F2 or whatever to change the virtual console, it will still show the squeezed screen. This is defnitely NVIDIA problem.. but at least my uptime is still going strong :)

Link to comment
Share on other sites

Guest fubar::chi
W/O too much thinking and w/o testing I would suggest (as root):

 

~# killall -g X

 

or, maybe:

 

~# killall -KILL -g X

 

If the above doesn't work (I'm sure it will), I suggest something more radical:

 

~# kill -9 $(ps aux | awk '$1 ~ /USER_NAME_HERE/ {print $2}')

Sweet. yet another way to kill errant processes. I love these. gentlemen i feel an faq coming on.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...