App::SuperviseMe - very simple command superviser
version 0.004
my $superviser = App::SuperviseMe->new( cmds => [ 'plackup -p 3010 ./sites/x/app.psgi', 'plackup -p 3011 ./sites/y/app.psgi', ['bash', '-c', '... bash script ...'], ], ); $superviser->run;
This module implements a multi-process supervisor.
It takes a list of commands to execute and starts each one, and then monitors their execution. If one of the program dies, the supervisor will restart it after a small 1 second pause.
You can send SIGTERM to the supervisor process to kill all childs and exit.
You can also send SIGINT (Ctrl-C on your terminal) to restart the processes. If a second SIGINT is received and no child process is currently running, the supervisor will exit. This allows you to tap Ctrl- C twice in quick succession in a terminal window to terminate the supervisor and all child processes
my $supervisor = App::SuperviseMe->new( cmds => [...], [debug => ...]);
Creates a supervisor instance with a list of commands to monitor.
It accepts a hash with the following options:
A list reference with the commands to execute and monitor. Each command can be a scalar, or a list reference.
Print progress information if true. Disabled by default.
Print debug information if true. ENV SUPERVISE_ME_DEBUG overrides this setting. Disabled by default.
my $supervisor = App::SuperviseMe->new_from_options;
Reads the list of commands to start and monitor from STDIN. It strips white-space from the beggining and end of the line, and skips lines that start with a #.
STDIN
#
Returns the superviser object.
$supervisor->run;
Starts the supervisor, start all the child processes and monitors each one.
This method returns when the supervisor is stopped with either a SIGINT or a SIGTERM.
AnyEvent
You can find documentation for this module with the perldoc command.
perldoc App::SuperviseMe
The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources.
MetaCPAN
A modern, open-source CPAN search engine, useful to view POD in HTML format.
http://metacpan.org/release/App-SuperviseMe
CPAN Testers
The CPAN Testers is a network of smokers who run automated tests on uploaded CPAN distributions.
http://www.cpantesters.org/distro/A/App-SuperviseMe
CPAN Testers Matrix
The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms.
http://matrix.cpantesters.org/?dist=App-SuperviseMe
CPAN Testers Dependencies
The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution.
http://deps.cpantesters.org/?module=App::SuperviseMe
CPAN Ratings
The CPAN Ratings is a website that allows community ratings and reviews of Perl modules.
http://cpanratings.perl.org/d/App-SuperviseMe
You can email the author of this module at MELO at cpan.org asking for help with any problems you have.
MELO at cpan.org
Please report any bugs or feature requests through the web interface at https://github.com/melo/App-SuperviseMe/issues. You will be automatically notified of any progress on the request by the system.
The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :)
https://github.com/melo/App-SuperviseMe
git clone git://github.com/melo/App-SuperviseMe.git
Pedro Melo <melo@simplicidade.org>
This software is Copyright (c) 2011 by Pedro Melo.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install App::SuperviseMe, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::SuperviseMe
CPAN shell
perl -MCPAN -e shell install App::SuperviseMe
For more information on module installation, please visit the detailed CPAN module installation guide.