Restore/Reload/Recover Crashed Gnome 3 Shell From tty1

Posted by on Jan 5, 2012 in Linux18 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.

Tags: , ,


» Comments RSS Feed
  1. We’re a group of volunteers and starting a new scheme in our community.
    Your web site offered us with valuable information to work
    on. You’ve done a formidable job and our entire community will be grateful to you.

  2. After looking into a number of the blog articles on your blog,
    I truly like your technique of writing a blog. I saved
    as a favorite it to my bookmark webpage list and will be checking back soon. Please visit my
    web site too and let me know how you feel.

  3. Hi colleagues, its enormous piece of writing about educationand completely
    explained, keep it up all the time.

  4. Your style is really unique compared to other
    people I’ve read stuff from. Thank you for posting when you have the opportunity, Guess I’ll just bookmark this web site.

  5. I like what you guys are usually up too. This
    kind of clever work and exposure! Keep up the amazing works guys I’ve incorporated you guys to my personal blogroll.

  6. I know this if off topic but I’m looking into
    starting my own weblog and was wondering what all is required to get set up?
    I’m assuming having a blog like yours would cost a pretty penny?
    I’m not very web smart so I’m not 100% sure.
    Any suggestions or advice would be greatly appreciated.

  7. I pay a visit every day a few web sites and blogs to read articles or reviews, however
    this website provides feature based writing.

  8. Greetings from Colorado! I’m bored to tears at work so I decided to check out your blog on my
    iphone during lunch break. I love the information you provide here and can’t wait to take a look when I get home.
    I’m shocked at how quick your blog loaded on my mobile ..
    I’m not even using WIFI, just 3G .. Anyhow, fantastic blog!

  9. You could certainly see your skills in the article you write.

    The world hopes for even more passionate writers such as you who are not afraid
    to say how they believe. All the time follow your heart.

  10. Hi! Do you know if they make any plugins to help with Search
    Engine Optimization? I’m trying to get my blog to rank for some targeted keywords
    but I’m not seeing very good gains. If you know of any please share.
    Many thanks!

  11. Howdy! This post couldn’t be written any better!

    Reading this post reminds me of my previous room mate!
    He always kept talking about this. I will forward this post to him.
    Pretty sure he will have a good read. Thank you for sharing!

  12. Good day! I could have sworn I’ve visited this site before but after browsing through
    some of the articles I realized it’s new to me. Anyhow, I’m certainly delighted I
    came across it and I’ll be bookmarking it and checking back

  13. We’re a bunch of volunteers and opening a brand new scheme in our community.

    Your web site provided us with valuable info to
    work on. You have performed an impressive job and our whole community
    can be grateful to you.

  14. Yes! Finally someone writes about perfect home.

  15. Wonderful site. Lots of helpful info here. I’m
    sending it to several friends ans also sharing in delicious.

    And obviously, thanks to your effort!

  16. Good day! I know this is kinda off topic but I was wondering
    if you knew where I could find a captcha plugin for my comment form?
    I’m using the same blog platform as yours and I’m having difficulty finding one?

    Thanks a lot!

  17. hello there and thank you for your information – I’ve certainly picked up anything new from right here.
    I did however expertise a few technical issues using this website,
    as I experienced to reload the website a lot of times
    previous to I could get it to load properly. I had been wondering if your hosting is OK?
    Not that I am complaining, but sluggish loading instances times will
    often affect your placement in google and can damage
    your high-quality score if ads and marketing
    with Adwords. Anyway I’m adding this RSS to my e-mail
    and can look out for a lot more of your respective intriguing content.
    Ensure that you update this again very soon.

  18. Right here is the perfect website for everyone who
    wishes to understand this topic. You realize a whole
    lot its almost tough to argue with you (not that I personally will need to…HaHa).
    You certainly put a fresh spin on a subject that has been discussed for ages.
    Excellent stuff, just great!

Leave a comment