Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 have a sinatra ruby script that I want to be running at all times.

Would it be the best to run it as a service? So I can restart it easily.

How can I install my script on OSX 10.6.2 as a service?

share|improve this question
up vote 2 down vote accepted

Use launchd and specify the following in your LaunchDaemon/LaunchAgent's configuration:

<key>KeepAlive</key>
<true/>

This optional key is used to control whether your job is to be kept continuously running or to let demand and conditions control the invocation. The default is false and therefore only demand will start the job. The value may be set to true to unconditionally keep the job alive. [...]


To restart, I believe you can just kill it and it'll come back automatically.

share|improve this answer
    
I think you wanted that to be <true/>. – Ben Alpert Mar 3 '11 at 7:55
    
@BenAlpert <true/> – Daniel Beck Mar 3 '11 at 9:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .