Skip to content

daemon_controller not worked for me. #12

Closed
@zw963

Description

@zw963

I have read README, it is fancy.

But it seem like not worked for me.

I have a redis-server binary file in $PATH, /usr/local/bin/redis-server.

if I start redis with redis-server ./redis.conf, it worked for me.
it will start up a background redis-server process, and accept response.

But I invoke with daemon_controller:

#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

require 'daemon_controller'

controller = DaemonController.new(
  :identifier => 'Redis process',
  :start_command => "redis-server /home/zw963/redis.conf",
  # :before_start => method(:before_start),
  :ping_command => [:tcp, 'localhost', 6379],
  :pid_file => 'redis.pid',
  :log_file => 'redis.log',
  :start_timeout => 5)

controller.start

it always failed with:

/home/zw963/Dropbox/common/ruby/gems/daemon_controller.rb:407:in `start_without_locking': Daemon 'Redis process' failed to start in time. (DaemonController::StartTimeout)
    from /home/zw963/Dropbox/common/ruby/gems/daemon_controller.rb:218:in `block in start'
    from /home/zw963/Dropbox/common/ruby/gems/daemon_controller/lock_file.rb:68:in `block in exclusive_lock'
    from /home/zw963/Dropbox/common/ruby/gems/daemon_controller/lock_file.rb:63:in `open'
    from /home/zw963/Dropbox/common/ruby/gems/daemon_controller/lock_file.rb:63:in `exclusive_lock'
    from /home/zw963/Dropbox/common/ruby/gems/daemon_controller.rb:217:in `start'
    from 1.rb:15:in `<main>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions