Class-Usul
view release on metacpan or search on metacpan
lib/Class/Usul/IPC.pm view on Meta::CPAN
=head2 C<process_table>
$res = $self->process_table( type => ..., );
Returns a hash reference representing the current process table
=head2 C<run_cmd>
$response = $self->run_cmd( $cmd, $opts );
Runs the given command. If C<$cmd> is a string then an implementation based on
the L<IPC::Open3> function is used. If C<$cmd> is an array reference then an
implementation using C<fork> and C<exec> in L<Class::Usul::IPC::Cmd> is used to
execute the command. If the command contains pipes then an implementation based
on L<IPC::Run> is used if it is installed. If L<IPC::Run> is not installed then
the arrayref is joined with spaces and the C<system> implementation is
used. The C<$opts> hash reference and the C<$response> object are described
in L<Class::Usul::IPC::Cmd>
On C<MSWin32> the L</popen> method is used instead. That method does not
support the C<async> option
=head2 C<signal_process>
Send a signal the the selected processes. Invokes the C<suid> root wrapper
=head2 C<signal_process_as_root>
$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 C<pid>, or an array ref
C<pids>, or C<file> must be passwd. The C<file> parameter should be a
path to a file containing process ids one per line. The C<sig> defaults to
C<TERM>. If the C<flag> parameter is set to C<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 C<force>
parameter is set to true the after a grace period each process and
it's children are sent signal C<KILL>
=head1 Diagnostics
None
=head1 Dependencies
=over 3
=item L<Class::Usul>
=item L<Class::Usul::Constants>
=item L<Class::Usul::IPC::Cmd>
=item L<Module::Load::Conditional>
=item L<Proc::ProcessTable>
=item L<Try::Tiny>
=back
=head1 Incompatibilities
There are no known incompatibilities in this module
=head1 Bugs and Limitations
There are no known bugs in this module.
Please report problems to the address below.
Patches are welcome
=head1 Author
Peter Flanigan, C<< <pjfl@cpan.org> >>
=head1 License and Copyright
Copyright (c) 2018 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 L<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
=cut
# Local Variables:
# mode: perl
# tab-width: 3
# End:
( run in 0.835 second using v1.01-cache-2.11-cpan-39bf76dae61 )