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" 但它说它不起作用
信息:瘦“向上”移动到“向上”我 [2014-05-02 23:37:09] 信息:瘦 [触发器] 进程未运行(ProcessRunning)我 [2014-05-02 23:37:09]信息:细移动“向上”到“开始”