Add monitoring basics

This commit is contained in:
2013-04-17 16:25:38 +02:00
parent b6a65d981f
commit 80057b0bf5
10 changed files with 104 additions and 0 deletions
@@ -0,0 +1,8 @@
after_fork do |server, worker|
# Start up the database connection again in the worker
if defined?(ActiveRecord::Base)
ActiveRecord::Base.establish_connection
end
child_pid = server.config[:pid].sub(".pid", ".#{worker.nr}.pid")
system("echo #{Process.pid} > #{child_pid}")
end