Skip to content

Instantly share code, notes, and snippets.

@wjlroe
Created September 15, 2009 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wjlroe/187391 to your computer and use it in GitHub Desktop.
Save wjlroe/187391 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
project_root = "/Users/will/projects/random"
server_script = File.join(project_root, 'script', 'server')
pid1 = Process.fork {
exec "#{server_script} start"
}
Process.detach(pid1)
puts "Server running with PID: #{pid1}"
10.times do
puts "Sleeping for a bit to show process is detached and running separately"
sleep 5
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment