Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use, and love, GNOME Do. Sometimes, though, it crashes and I have to re-run it from the menu. Is it possible to set up my GNOME session to automatically try to respawn Do?

I realize there are some caveats contemplating this - if my system gets into a state where Do cannot run at all, this would create an infinite loop of respawning, crashing, and respawning again, but in my experience Do crashes just enough for it to be slightly annoying, and never right after I restart it manually.

If someone can make a case for this being a bad idea, I'd consider that a good answer as well.

share|improve this question
you may want to troubleshoot the problem instead of just working around it. There is a discussion already about it in the question I mention above. If the problem cannot be solved, personally I would bind a keyboard shortcut to restart Gnome-Do, although you seem to be looking for a more automated solution. – Decio Lira Sep 26 '10 at 21:03
up vote 2 down vote accepted

You should be able to start it with a bash script that's basically "while(1){gnome-do}", ensuring that when gnome-do crashes, it gets run again. As long as gnome-do is run synchronously, it should work just fine. even if the system gets into a state where it can't be launched successfully, the impact would be small. If you want to ensure that even that is not a problem, insert a command using zenity. This would notify you that there was a problem, and require you to hit enter to start gnome-do again.

create a script with the following and launch it from the "Startup Applications" application found under the System Preferences menu.

while true
  zenity --info --text="gnome-do crashed ... press enter to restart"
share|improve this answer
That was a clever idea. I modified your script to the following: <code>while true; do gnome-do 2>> /home/username/gnome-do.log if [ "$?" -ne "0" ]; then notify-send --urgency=low --icon=gnome-do "GNOME-Do has crashed." "The cause of the crash has been logged to ~/gnome-do.log." else break fi done</code> Assuming that GNOME-Do exits with a non-zero exit code upon crashing, the script should notify me with a notification bubble and restart GNOME-Do. If I exit Do normally, it won't be restarted (if I ever want to get rid of it temporarily). STDERR goes to a log for debugging. – Tin Tvrtković Sep 27 '10 at 22:34
(It would appear I suck at formatting comments, but you get the gist of it) – Tin Tvrtković Sep 27 '10 at 22:37
I do, excellent idea, I think I'll actually run it myself. – Nerdfest Sep 28 '10 at 0:14

Your Answer


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.