How do I run a Sinatra app as a deamon from the command line?
It is using Thin:
ruby app.rb -p 3000 -e production
I don't like to set it up in the app.rb itself. I want to deamonise it from the command line.
From Start Sinatra app in the background with stdout and stderr redirected (append) to a file:
nohup ruby app.rb -p 3000 -e production >> log/log_file 2>&1 &
I don't know if it's possible with Ruby. But it's an easy task with rackup
.
Just add a config.ru:
require './app'
run Sinatra::Application
And with this in place you can start it as a daemon:
rackup -p 3000 -E production -D
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With