Skip to content

Instantly share code, notes, and snippets.

@psndcsrv
Created May 25, 2011 18:34
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 psndcsrv/991583 to your computer and use it in GitHub Desktop.
Save psndcsrv/991583 to your computer and use it in GitHub Desktop.
daemon_controller starting passenger
require 'rubygems'
require 'daemon_controller'
require 'socket'
ROOT = File.expand_path(File.dirname(__FILE__))
d = DaemonController.new(
:identifier => "Rails Backend",
:start_command => "passenger start -d -e test -p 3000",
:ping_command => lambda { TCPSocket.new('localhost', 3000)},
:pid_file => "#{ROOT}/rails/geniverse/passenger.3000.pid",
:log_file => "#{ROOT}/rails/geniverse/passenger.3000.log",
:timeout => 25
)
d.start
puts "started"
d.stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment