How to run sinatra application as deamon from command line?

how to run sinatra application as deamon from command line? He uses thin

ruby app.rb -p 3000 -e production 

I do not like to configure it in app.rb itself, I want to deamonize it from the command line.

+5
source share
2 answers

From https://serverfault.com/a/214186/219822

 nohup ruby app.rb -p 3000 -e production >> log/log_file 2>&1 & 
+2
source

I don't know if this is possible with ruby . But this is a simple task with rackup

Just add config.ru

 require './app' run Sinatra::Application 

And with that in place you can run it Daemon

rackup -p 3000 -E production -D

0
source

Source: https://habr.com/ru/post/1209432/


All Articles