Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

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.

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
add comment

Your Answer

 
discard

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.