Ask Your Question

Fedora20: Script to restart crashed program?

asked 2014-03-06 13:10:53 -0500

TopHatAce gravatar image

updated 2014-03-06 13:39:34 -0500

mether gravatar image

I'm not too good with writing scripts yet, although I was able to add a FIGlet and a fortune | cowsay line to my .bashrc file. I keep having issues with InSync in which the program closes silently and I have to restart it. Is there a way to write a script that will check if InSync is running and restart it if it is not?

edit retag flag offensive close merge delete


Please stop using # in tags. I have removed them

mether gravatar imagemether ( 2014-03-06 13:39:47 -0500 )edit

My apologies, the dropdown menu for the tags had octothorpes in front of them.

TopHatAce gravatar imageTopHatAce ( 2014-03-06 13:47:43 -0500 )edit

That was because of past misuse. I am trying to avoid others propogating it

mether gravatar imagemether ( 2014-03-06 14:14:39 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-03-07 03:57:06 -0500

marcindulak gravatar image

Install insync:

su -c "yum -y install"

Assuming you use bash, as an unpriviledged user: try this on the command line:

while true; do if test -z `ps o uid= -C insync | grep $(id -u)`; then echo launching; gtk-launch insync 2>/dev/null; fi; sleep 5; echo trying; done

If this works for you, remove the echo and increase the sleep time (in sec), and append the line to ~/.bashrc. Note that this method of restarting will not work if the program stops functioning (hangs), still having a pid. Why does insync crash? I shouldn't - report a bug to insync.

edit flag offensive delete link more

Question Tools



Asked: 2014-03-06 13:10:53 -0500

Seen: 149 times

Last updated: Mar 07 '14