CatalystX::Usul::IPC - List/Create/Delete processes
0.6.$Revision: 1165 $
use parent qw(CatalystX::Usul::IPC);
Displays the process table and allows signals to be sent to selected processes
@pids = $self->child_list( $pid );
Called with a process id for an argument this method returns a list of child process ids
$response = $self->popen( $cmd, @input );
Uses IPC::Open3 to fork a command and pipe the lines of input into it. Returns a CatalystX::Usul::IPC::Response object. The response object's out method returns the STDOUT from the command. Throws in the event of an error
CatalystX::Usul::IPC::Response
out
$bool = $self->process_exists( file => $path, pid => $pid );
Tests for the existence of the specified process. Either specify a path to a file containing the process id or specify the id directly
Generates the process table data used by the HTML::FormWidget table subclass. Called by "proc_table" in CatalystX::Usul::Model::Process
$response = $self->run_cmd( $cmd, $args );
Runs the given command by calling system. The keys of the $args hash are:
system
$args
If async is true then the command is run in the background
Debug status. Defaults to $self->debug
$self->debug
Passing err => q(out) mixes the normal and error output together
Input to the command
Logging object. Defaults to $self->log
$self->log
Destination for standard output
Directory used to store the lock file and lock table if the fcntl backend is used. Defaults to $self->tempdir
fcntl
$self->tempdir
Returns a CatalystX::Usul::IPC::Response object or throws an error. The response object has the following methods:
Returns true if the command generated a core dump
Contains a cleaned up version of the command's STDERR
Contains a cleaned up version of the command's STDOUT
The id of the background process. Only set if command is running async
The return value of the command
If the command died as the result of receiving a signal return the signal number
Contains the command's STDERR
Contains the command's STDOUT
Send a signal the the selected processes. Invokes the suid root wrapper
$self->signal_process( [{] param => value, ... [}] );
This is called by processes running as root to send signals to selected processes. The passed parameters can be either a list of key value pairs or a hash ref. Either a single pid, or an array ref pids, or file must be passwd. The file parameter should be a path to a file containing pids one per line. The sig defaults to TERM. If the flag parameter is set to one then the given signal will be sent once to each selected process. Otherwise each process and all of it's children will be sent the signal. If the force parameter is set to true the after a grace period each process and it's children are sent signal KILL
This interrupt handler traps the pipe signal
This interrupt handler traps the child signal
None
There are no known incompatibilities in this module
There are no known bugs in this module. Please report problems to the address below. Patches are welcome
Peter Flanigan, <Support at RoxSoft.co.uk>
<Support at RoxSoft.co.uk>
Copyright (c) 2011 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
To install CatalystX::Usul, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CatalystX::Usul
CPAN shell
perl -MCPAN -e shell install CatalystX::Usul
For more information on module installation, please visit the detailed CPAN module installation guide.