detach going away?

16 views
Skip to first unread message

pedz

unread,
Jun 18, 2011, 5:09:38 PM6/18/11
to beansta...@googlegroups.com
I forked the project to add a way to specify a pid file and discovered that detach is not in the current github source.

Is it going away?

I'm frustratingly trying to use God.  It seems that God is dead.  But thats another story.  What I wanted is to have beanstalkd started and monitored by God and then have my thin Rails processes depend upon the beanstalkd.  None of that seems to be working out very well.


pedz

unread,
Jun 18, 2011, 7:14:01 PM6/18/11
to beansta...@googlegroups.com
For those trying to use God, this is working for me:

RAILS_ROOT = "/Users/pedzan/Source/Rails/raptor"
God.pid_file_directory = File.join(RAILS_ROOT, "tmp/pids")

God.watch do |w|
  w.pid_file = w.pid_file
  w.start = "nohup /usr/local/bin/beanstalkd & echo $! > #{w.pid_file}"
  w.stop = "kill -INT $( cat #{w.pid_file})"

The setting the pid file equal to itself causes the pid file to be computed and then it is then set which triggers God into monitoring it differently.

It avoids using -d since that is now gone (I found the previous.)  This simply puts beanstalkd into the background and then echo $! into the pid_file.  Very simple.

Keith Rarick

unread,
Jun 18, 2011, 8:48:13 PM6/18/11
to beansta...@googlegroups.com
On Sat, Jun 18, 2011 at 2:09 PM, pedz <ped...@gmail.com> wrote:
> I forked the project to add a way to specify a pid file and discovered that
> detach is not in the current github source.
>
> Is it going away?

Yes. Avoiding -d makes it easier for process monitoring tools (such as,
for example, init) to restart the process if it crashes. Any good process
monitor will be able to control beanstalkd without -d. For example, the
documentation for god suggests you should omit the pid_file setting
when running beanstalkd.

kr

Reply all
Reply to author
Forward
0 new messages