# Deamons.rb: changing the pid directory

**URL:** <https://www.ruby-forum.com/t/deamons-rb-changing-the-pid-directory/150715>\
**Category:** Ruby\
**Created:** [October 12, 2008, 12:30am UTC](https://www.ruby-forum.com/t/deamons-rb-changing-the-pid-directory/150715 "2008-10-12T00:30:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![miken700](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@miken700](https://www.ruby-forum.com/u/miken700)\
**Post date:** [October 12, 2008, 12:30am UTC](https://www.ruby-forum.com/t/deamons-rb-changing-the-pid-directory/150715/1 "2008-10-12T00:30:16Z")

</div>

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/](http://daemons.rubyforge.org/)) ?

Thanks!  
Mike

---

<div class="post-metadata">

**Author:** ![miken700](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@miken700](https://www.ruby-forum.com/u/miken700)\
**Post date:** [October 12, 2008, 11:28am UTC](https://www.ruby-forum.com/t/deamons-rb-changing-the-pid-directory/150715/2 "2008-10-12T11:28:13Z")

</div>

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/](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 (:script option for

:dir\_mode)

# 2. in a directory given by :dir (:normal option

for :dir\_mode)

# 3. in the preconfigured directory /var/run

(:system option for :dir\_mode)
