I use Quicksilver, which is a nifty program that really speeds up my work. I've set it to launch when I log in.

However, since Snow Leopard, it's become a bit less stable, and once in a while, it crashes. And obviously, it won't restart by itself.

I'm pretty sure I can use launchd to ensure it's always running when I'm logged in. Is there a good guide/example of how to make sure a process restarts when it's killed/terminated/crashed with it?

link|improve this question

75% accept rate
feedback

2 Answers

up vote 1 down vote accepted

Googling for launchd quicksilver I got this:

http://www.zzamboni.org/brt/2008/01/28/using-launchd-to-immortalize-quicksilver-howto/index.html

...which looks right.

See man launchd.plist for more information about the keys you can put into a launchd plist file to control when and how launchd launches or re-launches processes.

link|improve this answer
Yup, looks right. I'll check it at home later. – zneak Apr 28 '10 at 13:33
Works perfectly fine! Thank you. – zneak Apr 29 '10 at 0:39
feedback

I have not tried this, as I don't have a mac, but I've been told it has bash as default shell these days. You could possibly get this going with a bash-script that you execute on logon by any means.

What it basically does is execute the given command repeatedly until it returns zero, which means it closed normally.

#!/bin/bash

RETVAL=1
until [ $RETVAL -eq 0 ]; do
    # change this to whatever is used to launch quicksilver
    /Applications/Quicksilver.app/Quicksilver

    RETVAL=$?
done

Edit: To clarify, put that in an empty text-file (optionally with an .sh-extension) and give it execute permissions (chmod +x filename) and it should work.

link|improve this answer
That's indeed a solution, though I'd prefer launchd since it's apparently its purpose. (Also, just so you know, executables are located inside the Contents/MacOS folder of an application bundle.) Thanks though, I didn't think about a shell script for the job before you mentioned it. – zneak Apr 27 '10 at 23:16
You clearly know nothing about Macs and should refrain from posting anything on the subject. – Hasaan Chop Apr 28 '10 at 1:51
1  
@Hasaan: While I mostly agree with your pointing out my lack of knowledge of macs, I do not see where my possible solution failed. It does what the OP wanted, just not in the way he wanted. For your enjoyment I will refrain from posting possible solutions to future problems, unless the solution in question is what the OP wanted, to the letter. – user32498 Apr 28 '10 at 6:19
@Hasaan Chop: You clearly know nothing about what I consider good or not and should refrain from posting anything on the subject. – zneak Apr 28 '10 at 13:32
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.