GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  PROC::PIDFILE (3)

.ds Aq ’

NAME

Proc::Pidfile - a simple OO Perl module for maintaining a process id file for the curent process

CONTENTS

SYNOPSIS



    my $pp = Proc::Pidfile->new( pidfile => "/path/to/your/pidfile" );
    # if the pidfile already exists, die here
    $pidfile = $pp->pidfile();
    undef $pp;
    # unlink $pidfile here

    my $pp = Proc::Pidfile->new();
    # creates pidfile in default location - /var/run or File::Spec->tmpdir ...
    my $pidfile = $pp=>pidfile();
    # tells you where this pidfile is ...

    my $pp = Proc::Pidfile->new( silent => 1 );
    # if the pidfile already exists, exit silently here
    ...
    undef $pp;



DESCRIPTION

Proc::Pidfile is a very simple OO interface which manages a pidfile for the current process. You can pass the path to a pidfile to use as an argument to the constructor, or you can let Proc::Pidfile choose one (basically, /var/run/$basename, if you can write to /var/run, otherwise /$tmpdir/$basename).

Pidfiles created by Proc::Pidfile are automatically removed on destruction of the object. At destruction, the module checks the process id in the pidfile against its own, and against its parents (in case it is a spawned child of the process that originally created the Proc::Pidfile object), and barfs if it doesn’t match either.

If you pass a silent parameter to the constructor, then it will still check for the existence of a pidfile, but will exit silently if one is found. This is useful for, for example, cron jobs, where you don’t want to create a new process if one is already running, but you don’t necessarily want to be informed of this by cron.

SEE ALSO

Proc::PID::File

REPOSITORY

<https://github.com/neilbowers/Proc-Pidfile>

AUTHOR

Ave Wrigley <awrigley@cpan.org>

Now maintained by Neil Bowers <neilb@cpan.org>

COPYRIGHT

Copyright (c) 2003 Ave Wrigley. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 PROC::PIDFILE (3) 2014-07-07

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.