Restore/Reload/Recover Crashed Gnome 3 Shell From tty1Posted by Hodge on Jan 5, 2012 in Linux • No comments •
I switched over to Linux Mint – a very nice Ubuntu derivative – a few releases back, and have just updated to “Lisa”, aka Linux Mint 12. The latest release uses Gnome 3, which is vastly different from Gnome 2 in pretty much every way. As much as I loved Gnome 2, I have to say, I don’t hate Gnome 3. In fact, I rather like it, despite its quirks, and my unfamiliarity concerning customising and tweaking. Besides, learning is half the fun of a new system.
One annoyance I have found to be somewhat of a show-stopper is that the Shell seems to crash on a fairly regular basis. I’m still trying to work out what is causing the crash – it could be one of the few extensions I have installed and modified to get the system looking and feeling the way I want, or some other bug related to the Shell, ATI Graphics driver, Xserver…
Unfortunately, when the shell crashes, the application windows remain, but all the panels and shell related stuff vanishes. It’s also not possible to use Alt-F2 to bring up the Run command widget, from which it’s possible to simply run “r” to reload the shell. Instead, I have had to find a couple of alternative methods to reload the shell. One is particularly drastic, and involves killing the whole Gnome session – not good if you have work to save etc. The other just replaces the shell.
The “Nice” Method
This method will replace the Gnome shell using tty1. As a result, all output from the gnome-shell command will be output to standard output on tty1, although this can be redirected to /dev/null or somewhere else if desired. To use this method, press Ctrl-Alt-F1 to change the display to tty1, and login if necessary. Then run:
DISPLAY=:0 gnome-shell --replace
This effectively tells the system to redirect the gnome-shell –replace command to tty7, i.e. the Xserver.
Once done, press Ctrl-Alt-F7 to return to Gnome.
The more aggressive method
This method will completely restart the Gnome session, killing any open applications in the process. This really is a last resort, and rather horrible method. Once again, press Ctrl-Alt-F1 to change the display to tty1. Once there, run:
ps aux | grep 'gnome-session'
You should see a few lines of output. What you’re looking for is (most likely the first line) the line similar to this:
username 4321 0.0 0.1 00000 00000 ? Ssl 09:48 0:00 /usr/bin/gnome-session --session=gnome
Where “username” is your username. Look specifically for “/usr/bin/gnome-session –session=gnome”. The number in the second column (after the username) is the value we’re after – in this case “4321″. This is the PID (Process ID) for gnome-session, and the value required to kill the session:
sudo kill -9 4321
This should kill the crashed Gnome Shell session, and start a new one. The display should also be returned to tty7, and the Login screen (if not, press Ctrl-Alt-F7).
If anyone else has any alternative, or better methods, please feel free to comment below.
Something not quite right? Inaccuracies or invalid code? Didn’t work for you? Don’t like me using Ss instead of Zs? Add a comment below! All comments are welcome. Except spam, because spam is a bit crap.
Alldaymall(TM) 7-inch Capacitive Touch Screen Android 4.0 Tablet PC with Allwinner A13 1.0GHz 512MB/4GB WiFi Front-camera (Black)
Alldaymall owns this trademark exclusively Basic Configuration Operating System: Android 4.0 CPU: Allwinner A13 1.0GHz GPU: Mali-400 RAM: 512MB DDR3 Internal Memory: 4GB Expansion Memory: Support micro SD/TF card up to 32GB Keyboard Type: Virtual keyboard Input Mode: Handwritten and keyboard input Display Screen Screen Size: 7-inch Screen Type: Capacitive 5-point touch screen Screen Resolution:…
7” A13 Google Android 4.0 AllWinner Tablet Boxchip Cortex A8 1.2Ghz MID Capacitive Touch Screen G-sensor WIFI, Camera, Skype Video Calling, Netflix, Flash Supported Dragon Touch(TM) MID7134B [By TabletExpress] (4GB Black)
TabletExpress is ONLY one authorized distributor by Dragon Touch(TM) in North America.Buy genius Dragon Touch (TM) tablet from TabletExpress only.
Operation system: Android 4.0 Support HD Flash 11
Main IC: Allwinner A13 (CPU+ GPU+ VPU) Cortex A9 1.2G
Screen: 7 inches 5 Points Capacitive Touch 16:9 .800 * 480
Memory: DDR3 512MB
Storage Extend: 128MB-32GB SD/TF Sup…