Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My computer seems to have issues suspending and resuming properly. Most recently, it resumed from hibernate, was working fine until I started logging in, and then X froze completely. I can log in via SSH (and it works flawlessly when I do), and I'd love to reset it without restarting the whole computer, and preferably without crashing all my open applications.

Is this doable? If I have to crash the open apps, that's OK too, I suppose, but not preferred.

share|improve this question
add comment

5 Answers

I know hibernation still has a lot of issues with a wide variety of hardware in Ubuntu. You can restart X I believe with service gdm restart (or /etc/init.d/gdm restart) you should be able to get X reset. If you use Kubuntu or KDE you'll want to use service kdm restart (or /etc/init.d/kdm restart)

share|improve this answer
    
in 10.04 you can do service gdm restart –  Joshua Aug 9 '10 at 19:08
    
I suppose that is correct - service has been around for a while but Ubuntu is trying to push people away from using /etc/init.d/ in favor of service I'll update my answer. –  Marco Ceppi Aug 9 '10 at 19:14
add comment

If you need to restart X frequently you can do it with the Key combo Control + Alt + Backspace. It used to be enabled by default on Ubuntu but they have disabled it since 9.04 version I guess.

To re-enable it:

  • Select “System”->”Preferences”->”Keyboard”
  • Select the “Layouts” tab and click on the “Options” button.
  • Select “Key sequence to kill the X server” and enable Control + Alt + Backspace.

I suggest you keep looking to find the root of your problem since this is just a paliative, but should help you for now.

share|improve this answer
1  
If I'm not mistaken that won't work since the X session (and the keyboard commands) are locked up. –  Marco Ceppi Aug 9 '10 at 1:56
add comment

Technically, with these kinds of "X freeze" issues, it's actually not that X itself froze up, but rather that the GPU on the video card locked up for some reason, and thus X could no longer update graphics on it.

So because of that, resetting X generally isn't going to solve the problem. Like the prior two commenters mentioned, several easy ways exist to restart X such as restarting gdm or kdm, or turning on ctrl-alt-backspace and using that key combo. But next time "X freezes", go ahead and try them, and I'll bet it has no effect.

The problem really is deeper down in the stack, at the kernel level. Possibly if you closed X, unloaded and reloaded all the kernel graphics drivers, then restarted X it'd come up. But in restarting X you lose all your apps. So other than an interesting test, it's probably faster and safer to just do a full reboot.

You didn't mention which video driver you're using, but with for instance the Intel video driver, the GPU is handled by code in the Linux kernel itself. Some developers have been experimenting with adding a "GPU reset" feature in the kernel that will automatically clear the GPU's memory and re-initialize it when it seems to no longer be responding to graphics commands. This reset functionality is new and doesn't always work in all cases for various reasons, and isn't (yet) available for the nouveau or ati open source video drivers. Hopefully it'll be coming soon.

If you're using a proprietary driver like nvidia or fglrx, well all bets are off. Check the forums for those drivers for tips.

share|improve this answer
add comment

Btw, you said "X froze completely" which if true my previous answer applies. However, a common failure mode I've seen is a problem where when the lid closes the screen goes blank and doesn't come back, however X is not frozen in this case - all the GUI apps still run and produce noise and so on. You just don't see anything on the screen.

In this case, it's a very different problem - the graphics card is able to send graphics to several different "outputs" (E.g. LVDS, DVI, VGA, TV-out) but only two "pipes" at one time. Sometimes it chooses the wrong output to send data to. So initially graphics is sent to the laptop panel (LVDS), you close the lid, reopen it, and now graphics are being sent to the TV-out output, even if you don't actually have a physical TV-out port in the laptop itself!

The fix in this case is generally to force-off the wayward output. It used to be you could just put something in your xorg.conf to do this, but now with kernel mode-setting it's not so easy. In any case, I've documented both methods at https://wiki.ubuntu.com/X/Quirks if you want to know the gritty details of how to do it.

share|improve this answer
    
Luckily, in this case, it's not a laptop, but this is interesting. I didn't know this was ever a problem. –  mlissner Aug 9 '10 at 16:27
add comment

Since the computer is not locked up, Alt+SysRq+k should kill/restart your X server. Type it on the X VT not on a console VT.

share|improve this answer
    
Good answer, SysRq is designed to work, regardless of system state - en.wikipedia.org/wiki/Magic_SysRq_key –  invert Aug 10 '10 at 10:46
1  
SysRq is often located on the Print Screen (or "Prnt Scrn") key, especially on laptops, so you might have to press Alt + PrntScrn + k. –  Ryan Thompson Aug 11 '10 at 17:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.