FooBarWidget/daemon_controller — Issue #6: simple daemon doe's not work
Author: romanvbabenko
Created: 2011-12-29 00:01:42+00:00
State: open

#!/usr/bin/env ruby

require 'bundler/setup'

require 'daemon_controller'
require 'socket'

controller = DaemonController.new(
:identifier => 'loop server',
:start_command => Dir.pwd + '/loop',
:ping_command => lambda { true },
:pid_file => 'loops.pid',
:log_file => 'loops.log',
:start_timeout => 25,
:daemonize_for_me => true
)
controller.start

loop executable file

#!/usr/bin/env ruby

loop { sleep(100)}

after start

uby-1.9.2-p290/gems/daemon_controller-0.2.6/lib/daemon_controller.rb:370:in `start_without_locking': Daemon 'loop server' failed to start in time. (DaemonController::StartTimeout)
.../.rvm/gems/ruby-1.9.2-p290/gems/daemon_controller-0.2.6/lib/daemon_controller.rb:198:in `block in start'