mojombo / god

Ruby process monitor
http://godrb.com
MIT License
2.21k stars 538 forks source link

WARN: technical_worker start command exited with non-zero code = 1 #124

Open ohadperry opened 11 years ago

ohadperry commented 11 years ago

I am getting this error when starting god like so god -c config/workers.god -D: WARN: technical_worker start command exited with non-zero code = 1

my config/working.god file is like so :

p ROOT = Dir.pwd#File.dirname(File.dirname(__FILE__))

p Dir.pwd
def generic_monitoring(w, options = {})
  #generic preferences...
end

God.watch do |w|
  script = "ruby #{ROOT}/worker/deamonds.rb"
  w.name = "technical_worker"
  w.group = "financial_workers"
  w.interval = 60.seconds
  w.start = "#{script} start"
  w.restart = "#{script} restart"
  w.stop = "#{script} stop"
  w.start_grace = 20.seconds
  w.restart_grace = 20.seconds
  w.pid_file = "#{ROOT}/log/technical_worker.pid"

  w.behavior(:clean_pid_file)

  generic_monitoring(w, :cpu_limit => 30.percent, :memory_limit => 20.megabytes)
end

and my worker/deamonds.rb file is like so:

# ROOT = Dir.pwd unless defined?(ROOT)
require "#{ROOT}/worker/technical_worker.rb"

technical = File.join(File.dirname(__FILE__), '..', 'worker', 'technical_worker.rb')
options = {
  :app_name   => "technical_worker",
  # :ARGV       => ARGV,
  :dir_mode   => :normal,
  :dir        => File.join(File.dirname(__FILE__), '..', 'log'),
  :log_output => true,
  :multiple   => false,
  :backtrace  => true,
  :monitor    => false
}

Deamons.run(technical, options)

when I start the deamon like so:

ruby worker/deamonds.rb start

then it starts fine. I think the issue is security related but I'm not so sure..

sree0514 commented 11 years ago

+1