Restarting Xserver from cli

Joep L. Blom jlblom at neuroweave.nl
Thu Mar 19 09:07:33 UTC 2009


Knapp wrote:
> On Thu, Mar 19, 2009 at 1:35 AM, Ray Parrish <crp at cmc.net> wrote:
>> Joep L. Blom wrote:
>>> Ray Parrish wrote:
>>>
>>>> Bart Silverstrim wrote:
>>>>
>>>>> David Curtis wrote:
>>>>>
>>>>>
>>>>>
>>>>>> To me, removing C-A-B to limit this issue, is a sound decision.
>>>>>>
>>>>>>
>>>>> Not for people like me who have used Linux for many moons now, and when
>>>>> X locks up that is one of the first methods to regain some form of
>>>>> control...what's the alternative if you don't have another system to try
>>>>> SSH'ing into it and checking processes?
>>>>>
>>>> Uh, CTRL-ALT-F1??? or F2, F3, etc... 8-) Although, since I'm still a
>>>> noob, when I do an F1 to the console, I usually wind up doing a sudo
>>>> reboot from there to continue, as I'm not really sure yet what to do
>>>> once I get there. I'm sure with a little more reading on my part, that
>>>> it's possible to query, and kill processes from the other tty to get it
>>>> running properly again, and then log back into it.
>>>>
>>>> Later, Ray Parrish--
>>>>
>>>> Human reviewed index of links about the computer
>>>> http://www.rayslinks.com
>>>> Poetry from the mind of a Schizophrenic
>>>> http://www.writingsoftheschizophrenic.com/
>>>>
>>>>
>>>>
>>> Ray,
>>> After CTRL+ALT+Fn(n=1-6) do CTRL-ALT-F7 and you're back in your X-session.
>>> Joep
>>>
>> Thanks! Can I actually query and kill hung processes from 7 while logged
>> into 1?
>>
>> Later, Ray Parrish
> 
> Is this question in two threads or am I going crazy?
> You can kill it. If you can't then kill it with sudo kill.
> use htop to find what needs killing and to do the killing. Then jump
> back to f7. See my other post for more details.
> 
> 
Douglas,
I answered last evening and then went to bed so I couldn't clarify.
Your answers are absolutely right.
Do Ctrl-Alt-Fn (n=1-6) and start a session (in such a case I prefer a 
root-session).
Then I use ps -ef|grep <whatever> to find the offending process(es).
It is not a panacee. Sometimes besides X kernel processes are so 
'mangled' that Ctrl-Alt-Fn doesn't work. Sometimes the network processes 
and sshd are still working and logging in from another system can be 
used to try to solve the problem (mostly killing X). If that also fails, 
it's the big black button.

I have seen in this thread a few times people stopping X with 
/etc/init.d/gdm stop. I think it's much easier to use the (old?) command 
service (as root), and in the same vein why people are using gdm or kdm 
when the good old startx still works?
Joep





More information about the ubuntu-users mailing list