https://github.com/dnmfarrell/ipc-pidfile
https://github.com/dnmfarrell/ipc-pidfile
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dnmfarrell/ipc-pidfile
- Owner: dnmfarrell
- License: other
- Created: 2015-10-27T16:14:14.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-09-30T19:46:36.000Z (over 7 years ago)
- Last Synced: 2025-10-10T17:03:15.171Z (8 months ago)
- Language: Perl
- Size: 4.88 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.pod
- License: LICENSE
Awesome Lists containing this project
README
=pod
=encoding UTF-8
=head1 NAME
IPC::Pidfile - run only one instance of a program at a time
=head1 VERSION
version 0.02
=head1 SYNOPSIS
Just import the module:
#!/usr/bin/env perl
use IPC::Pidfile;
... # program code here
This will create a pidfile for the program and clear it up when the program is
finished.
=head1 DESCRIPTION
C is a module for use with Perl programs when you only want one
instance of the script to run at a time. It should work for you if:
=over 4
=item *
You are OK with the pidfile being created in the same directory as the
script
=item *
You are not using an obscure OS. (Linux, BSD, OSX and Windows should be OK,
see CPANTESTERS).
=item *
Your program is not using signal handlers for C and C.
C uses these to clear up the pidfile at the end of the process
=back
=head1 WARNING
This module has a race condition as it attempts to remove the pidfile. It
might be better to use C.
=head1 BUGS/ISSUES
Race condition (see L<#WARNING>).
This is an early release and may contain bugs. To run C in
debug mode, create the environment variable C:
IPC_PIDFILE_DEBUG=1 ./path/to/program
=head1 AUTHOR
David Farrell
=head1 COPYRIGHT AND LICENSE
This software is Copyright (c) 2015 by David Farrell.
This is free software, licensed under:
The (two-clause) FreeBSD License
=cut