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?

link|improve this question

feedback

1 Answer

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.

link|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
feedback

Your Answer

 
or
required, but never shown

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