Process::KillTree - Kill process and all its descendants (children, grandchildren, ...)
version 0.03
use Process::KillTree qw(kill_tree); my $pid = ...; kill_tree pid => $pid, signal => 'KILL';
This module provides kill_tree().
Process::KillGroup
Kill process and all its descendants (children, grandchildren, ...).
To find out about child processes, Sys::Statistics::Linux::Processes is used on Linux. Croaks on other operating systems.
Returns the killed PIDs.
Arguments ('*' denotes required arguments):
action => code
If specified, will call action instead of killing the processes.
Code will be supplied $pids, an arrayref containing all the PIDs to kill.
pid => int
Process ID to kill.
Either pid or pids must be specified
pids => array
Process IDs to kill.
signal => str (default: "TERM")
Signal to use, either numeric (e.g. 1), or string (e.g. KILL).
Return value:
Returns an enveloped result (an array). First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (result) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.
Steven Haryanto <stevenharyanto@gmail.com>
This software is copyright (c) 2012 by Steven Haryanto.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Process::KillTree, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Process::KillTree
CPAN shell
perl -MCPAN -e shell install Process::KillTree
For more information on module installation, please visit the detailed CPAN module installation guide.