- SEE ALSO
- COPYRIGHT AND LICENSE
App::SuperviseMe - very simple command superviser
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
Returns the superviser object.
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.
You can find documentation for this module with the perldoc command.
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.
A modern, open-source CPAN search engine, useful to view POD in HTML format.
The CPAN Testers is a network of smokers who run automated tests on uploaded CPAN distributions.
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.
CPAN Testers Dependencies
The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution.
The CPAN Ratings is a website that allows community ratings and reviews of Perl modules.
You can email the author of this module at
MELO at cpan.org asking for help with any problems you have.
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 :)
git clone git://github.com/melo/App-SuperviseMe.git
Pedro Melo <email@example.com>
This software is Copyright (c) 2011 by Pedro Melo.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)