views:

633

answers:

1

I was using god to start and monitor my starling and workling daemons.

Works awesome on development machine but "workling_starling_client" refuses to start on my production machine.

+3  A: 

I realized that by explicitly doing

export RAILS_ENV=production

my workling-starling-client started up properly.

Therefore I had to declare RAILS_ENV variable before issuing god config file

RAILS_ENV=production god -d config/monitor_daemons.god -t

I'm also using the variable to start starling daemon in production port

STARLING_PORT = ENV['RAILS_ENV'] == 'production' ? '-p 15151' : ''

God.watch do |w|
  ...
  w.start = "starling -d -P log/starling.pid -q log/ #{STARLING_PORT}"
  ...
end

God.watch do |w|
  ...
  w.start = "script/workling_starling_client start"
  ...

end

JasonOng