Restore/Reload/Recover Crashed Gnome 3 Shell From tty1

Posted by on Jan 5, 2012 in Linux1 commentPrint This Post

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.





















Dragon Touch® 7'' Black Dual Core Y88 Google Android 4.1 Tablet PC, Dual Camera, HD 1024x600, 4GB, Google Play Pre-load, HDMI, 3D Game Supported (enhanced version of A13)[By TabletExpress]


Dragon Touch® 7” Black Dual Core Y88 Google Android 4.1 Tablet PC, Dual Camera, HD 1024×600, 4GB, Google Play Pre-load, HDMI, 3D Game Supported (enhanced version of A13)[By TabletExpress]


$57.99


Trademark Dragon Touch products are marketed exclusively by TabletExpress. Specification:
Operating System: Google Android 4.1 (Jelly Bean)
Display: 7 Inch Multi-touch screen (1024×600)
CPU: iMAP X15 Dual Core, up to 1.2 GHz processor;
GPU: Quad core ARM Mali 400 MP GPU
Internal Memory: 4 GB Memory Expansion: MicroSD card (up to 32
GB in size)
RAM: 512MB DDR3
Camera: Front facing plus rear camer…

NeuTab N7 7'' Dual Core Google Android 4.1 Jelly Bean Tablet PC, 1024X600 HD, Dual Camera, Google Play Pre-loaded, 3D-Game Supported


NeuTab N7 7” Dual Core Google Android 4.1 Jelly Bean Tablet PC, 1024X600 HD, Dual Camera, Google Play Pre-loaded, 3D-Game Supported


$54.95


NeuTab(TM) N7 – 7 inch mysteryThe 7 inch screen is proven to be the most popular and meaningful screen size thatmakes your hand comfortable as well as your mind. Holding this tablet will nevermake you tired. The HD screen gives sharp and easily recognized fonts and imagesso you or your kid will not frown upon any.Stay connectedBuilt-in WiFi keeps you connected to your friends and social network. D…

Tags: , ,