Forum: Ruby Deamons.rb: changing the pid directory

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Eb4ffc850ae4f13e7e5602b53fe49772?d=identicon&s=25 Mike Nicholaides (nicholaides)
on 2008-10-12 00:30
Hey folks,

Does anyone know how I can change the directory that the pid file is put
in when using the Daemons gem (http://daemons.rubyforge.org/) ?

Thanks!
Mike
753dcb78b3a3651127665da4bed3c782?d=identicon&s=25 Brian Candler (candlerb)
on 2008-10-12 11:28
Look in the rdoc documentation for Daemons::Pidfile. If daemons is
installed as a gem, then

  gem server --daemon

and point web browser at http://localhost:8808/

Or just read the comments in the source, which will probably be
installed somewhere like

/usr/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/pidfile.rb

There you will find the following documentation:

  # === Where are the Pid-Files stored?
  #
  # Daemons is configurable to store the Pid-Files relative to three
different locations:
  # 1.  in a directory relative to the directory where the script (the
one that is supposed to run
  #     as a daemon) resides (<tt>:script</tt> option for
<tt>:dir_mode</tt>)
  # 2.  in a directory given by <tt>:dir</tt> (<tt>:normal</tt> option
for <tt>:dir_mode</tt>)
  # 3.  in the preconfigured directory <tt>/var/run</tt>
(<tt>:system</tt> option for <tt>:dir_mode</tt>)
This topic is locked and can not be replied to.