NAME
Proc::PID_File - manage PID files
SYNOPSIS
use Proc::PID_File;
$pid_file = Proc::PID_File->new(path=>"/var/log/mydaemon.pid");
if (!$pid_file->create) { die "Can't create pid file"; }
if ($pid_file->previously_exists) { die "I was already started."; }
$SIG{INT} = $SIG{TERM} = sub { $pid_file->delete; exit; };
# go ahead, daemonize...
DESCRIPTION
This module provides a simple interface to manage PID files. A
PID file is a place to store the process ID number of a process,
created by the process itself when it starts. A valid (i.e. not
stale) PID file indicates that the process instance is still
alive, and can indicate that the program should not start
another instance when invoked. PID files are also used to record
the process ID number of daemon processes so that they can be
signalled (e.g. TERM-ed or HUP-ed).
AUTHOR
Copyright (C) 2000, Steven Haryanto <steven@haryan.to>. All
rights reserved.
This module is free software; you may redistribute it and/or
modify it under the same terms as Perl itself.
HISTORY
000731 - first hack