Skip to content

Commit

Permalink
Added config for 'god' to daemonize node.js server. Closes #3.
Browse files Browse the repository at this point in the history
  • Loading branch information
sphynx committed Feb 14, 2011
1 parent 60a295a commit 5bacd64
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions conf/chapayev.god
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
APP_ROOT = "/home/sphynx/js"

God.pid_file_directory = "#{APP_ROOT}/pids"

God.watch do |w|
w.name = "chapayev"
w.interval = 5.seconds # default
w.start = "env node #{APP_ROOT}/server.js"
w.stop = "env killall node"
w.start_grace = 10.seconds
w.restart_grace = 10.seconds
w.log = "#{APP_ROOT}/log/chapayev.log"

w.start_if do |start|
start.condition(:process_running) do |c|
c.interval = 5.seconds
c.running = false
end
end
end

0 comments on commit 5bacd64

Please sign in to comment.