| Class | Daemonize::PidFile |
| In: |
lib/dctl/pidfile.rb
|
| Parent: | Object |
A Pid-File is a file containing the process identification number (pid) that is stored in a well-defined location of the filesystem thus allowing other programs to find out the pid of a running script.
Dctl needs the pid of the scripts that are currently running in the background to send them so called signals. Dctl uses the TERM signal to tell the script to exit when you issue a stop command.
Pid-Files generated by Dctl have to following format:
<basename>.pid
This file just contains one line with the pid as string (for example 6432).
Dctl stores the Pid-files relative to two different locations:
# File lib/dctl/pidfile.rb, line 28
28: def initialize(path, name)
29: # Test if this directory is valid.
30: Dir.new path
31: raise Errno::EACCES, path unless File.writable? path and File.readable? path
32: @pathname = File.join(File.expand_path(path), name) + '.pid'
33: end