Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I can get some random shell script to run as a service...that's not the problem. I think it's related to environment variables given some of the google-ing I did. Either a list of required rails environment variables or a sample rails app running as a service would be helpful.

I found this:
http://serverfault.com/questions/327965/how-to-start-a-rake-task-using-upstart
Which is helpful, but it incorporates rvm. I like rvm, but I'm looking for a way to do it without this additional bit of complexity. I may be forced to do it that way though...

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Assuming bundle install --deployment --binstubs make sure you create a stub bin/bundle (Bundler does not do this). Then in /etc/init/your-app.conf:

start on started network-services
stop on stopping network-services

<set env variables you need>

script
pushd <Your app's Gemfile folder>
bin/bundle exec ....
end script

That should do it.

share|improve this answer
    
upvote. after i verify it working in my implementation i'll give it the check –  hbdgaf Mar 6 '12 at 4:12

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.