Skip to content

Instantly share code, notes, and snippets.

@stopdropandrew
Created June 1, 2010 23:27
Show Gist options
  • Save stopdropandrew/421683 to your computer and use it in GitHub Desktop.
Save stopdropandrew/421683 to your computer and use it in GitHub Desktop.
after_fork do |server, worker|
port = 5000 + worker.nr
child_pid = server.config[:pid].sub('.pid', ".#{port}.pid")
system("echo #{Process.pid} > #{child_pid}")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment