RAILS_ROOT = File.dirname(File.dirname(__FILE__))
God.watch do |w|
pid_file = File.join(RAILS_ROOT, "tmp/pids/server.pid")
w.name = "thin"
w.interval = 60.seconds
w.start = "rails server -e production"
w.stop = "kill -s QUIT $(cat #{pid_file})"
w.restart = "kill -s HUP $(cat #{pid_file})"
w.start_grace = 20.seconds
w.restart_grace = 20.seconds
w.pid_file = pid_file
w.behavior(:clean_pid_file)
# When to start?
w.start_if do |start|
start.condition(:process_running) do |c|
# We want to check if deamon is running every ten seconds
# and start it if itsn't running
c.interval = 10.seconds
c.running = false
end
end
я пробовал w.start = "rails server -e production", но он не работает, он говорит
ИНФОРМАЦИЯ: тонкий перемещен 'вверх' на 'вверх' I [2014-05-02 23:37:09] ИНФОРМАЦИЯ: тонкий [триггерный] процесс не запущен (ProcessRunning) I [2014-05-02 23:37:09] ИНФОРМАЦИЯ: тонкое движение «вверх» к «старту»