non-daemon process using Bundler

115 views
Skip to first unread message

Christopher J. Bottaro

unread,
Mar 16, 2012, 2:36:49 PM3/16/12
to god...@googlegroups.com
Hello,

I'm having a problem with god trying to watch a non-daemon process that is started by "bundle exec".

God starts the process just fine, as seen by ps:

6856 ?        Ss     0:00 sh -c bundle exec rake resque:scheduler >> /home/rails/project_a/shared/log/scheduler.log 2>&1
6860 ?        Sl     0:23 ruby /home/rails/project_a/shared/bundle/ruby/1.9.1/bin/rake resque:scheduler

The problem is that god is monitoring the first process (6856), so that a "god stop" or "god restart" nukes the first process, but the second one remains.

Any ideas?  Thanks for the help.

Pete Shima

unread,
Mar 16, 2012, 8:42:55 PM3/16/12
to god...@googlegroups.com
Hi Chris,

I'd guess the issue is that god is starting your sh shell and the shell is starting ruby, rather than god.  I am not sure how god deals with processes like these but I'd guess the issue not to be with bundle exec.

I'd suggest running resque scheduler directly without wrapping in sh -c if your environment allows.

here's my w.start command that is confirmed to be working correctly under bundle exec

w.start = "#{BIN_PATH}/bundle exec rake -f #{RAILS_ROOT}/Rakefile resque:scheduler"

Hope this helps.
--
You received this message because you are subscribed to the Google Groups "god.rb" group.
To view this discussion on the web visit https://groups.google.com/d/msg/god-rb/-/W83Awd_b3mkJ.
To post to this group, send email to god...@googlegroups.com.
To unsubscribe from this group, send email to god-rb+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/god-rb?hl=en.

Christopher J. Bottaro

unread,
Mar 17, 2012, 9:55:43 PM3/17/12
to god...@googlegroups.com
Hey Pete,

Thanks for the reply.  Surprisingly enough, I resolved this issue by letting god handle the log file.  In other words, I changed my god config like so:

  w.start     = "bundle exec rake resque:scheduler >> /home/rails/project_a/shared/log/scheduler.log 2>&1"
to
  w.start     = "bundle exec rake resque:scheduler"
  w.log       = "#{SHARED_PATH}/log/scheduler.log"

Not sure why that fixed it.  Probably has something to do with Bash/Unix process intricacies that I don't fully understand.

-- C
To unsubscribe from this group, send email to god-rb+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages