App-ProcUtils
view release on metacpan or search on metacpan
Check if processes that match criteria exists.
This function is not exported.
Arguments ('*' denotes required arguments):
* cmdline_match => *re*
(No description)
* cmdline_not_match => *re*
(No description)
* code => *code*
Code is given Proc::ProcessTable::Process object, which is a hashref
containing items like "pid", "uid", etc. It should return true to
mean that a process matches.
* exec_match => *re*
(No description)
* exec_not_match => *re*
(No description)
* logic => *str* (default: "AND")
(No description)
* pids => *array[unix::pid]*
(No description)
This function is not exported.
This function supports dry-run operation.
Arguments ('*' denotes required arguments):
* cmdline_match => *re*
(No description)
* cmdline_not_match => *re*
(No description)
* code => *code*
Code is given Proc::ProcessTable::Process object, which is a hashref
containing items like "pid", "uid", etc. It should return true to
mean that a process matches.
* exec_match => *re*
(No description)
* exec_not_match => *re*
(No description)
* logic => *str* (default: "AND")
(No description)
* pids => *array[unix::pid]*
(No description)
List processes that match criteria.
This function is not exported.
Arguments ('*' denotes required arguments):
* cmdline_match => *re*
(No description)
* cmdline_not_match => *re*
(No description)
* code => *code*
Code is given Proc::ProcessTable::Process object, which is a hashref
containing items like "pid", "uid", etc. It should return true to
mean that a process matches.
* detail => *true*
Return detailed records instead of just PIDs.
* exec_match => *re*
(No description)
* exec_not_match => *re*
(No description)
* logic => *str* (default: "AND")
(No description)
* pids => *array[unix::pid]*
(No description)
lib/App/ProcUtils.pm view on Meta::CPAN
our $VERSION = '0.039'; # VERSION
our %SPEC;
our %args_filtering = (
cmdline_match => {
schema => 're*',
tags => ['category:filtering'],
pos => 0,
},
cmdline_not_match => {
schema => 're*',
tags => ['category:filtering'],
},
exec_match => {
schema => 're*',
tags => ['category:filtering'],
},
exec_not_match => {
schema => 're*',
tags => ['category:filtering'],
},
pids => {
'x.name.is_plural' => 1,
'x.name.singular' => 'pid',
schema => ['array*', of=>'unix::pid*'],
tags => ['category:filtering'],
},
uids => {
lib/App/ProcUtils.pm view on Meta::CPAN
my $cmdline = join(" ", grep {$_ ne ''} @{ $proc_entry->{cmdline} });
my $exec = $proc_entry->{exec} // '';
if (defined $args{cmdline_match}) {
if ($cmdline =~ /$args{cmdline_match}/) {
goto MATCH if $is_or;
} else {
next ENTRY unless $is_or;
}
}
if (defined $args{cmdline_not_match}) {
if ($cmdline !~ /$args{cmdline_not_match}/) {
goto MATCH if $is_or;
} else {
next ENTRY unless $is_or;
}
}
if (defined $args{exec_match}) {
if ($exec =~ /$args{exec_match}/) {
goto MATCH if $is_or;
} else {
next ENTRY unless $is_or;
}
}
if (defined $args{exec_not_match}) {
if ($exec !~ /$args{exec_not_match}/) {
goto MATCH if $is_or;
} else {
next ENTRY unless $is_or;
}
}
if (defined $args{pids}) {
if (grep {$proc_entry->{pid} == $_} @{ $args{pids} }) {
goto MATCH if $is_or;
} else {
next ENTRY unless $is_or;
lib/App/ProcUtils.pm view on Meta::CPAN
This function is not exported.
Arguments ('*' denotes required arguments):
=over 4
=item * B<cmdline_match> => I<re>
(No description)
=item * B<cmdline_not_match> => I<re>
(No description)
=item * B<code> => I<code>
Code is given L<Proc::ProcessTable::Process> object, which is a hashref
containing items like C<pid>, C<uid>, etc. It should return true to mean that a
process matches.
=item * B<exec_match> => I<re>
(No description)
=item * B<exec_not_match> => I<re>
(No description)
=item * B<logic> => I<str> (default: "AND")
(No description)
=item * B<pids> => I<array[unix::pid]>
(No description)
lib/App/ProcUtils.pm view on Meta::CPAN
Arguments ('*' denotes required arguments):
=over 4
=item * B<cmdline_match> => I<re>
(No description)
=item * B<cmdline_not_match> => I<re>
(No description)
=item * B<code> => I<code>
Code is given L<Proc::ProcessTable::Process> object, which is a hashref
containing items like C<pid>, C<uid>, etc. It should return true to mean that a
process matches.
=item * B<exec_match> => I<re>
(No description)
=item * B<exec_not_match> => I<re>
(No description)
=item * B<logic> => I<str> (default: "AND")
(No description)
=item * B<pids> => I<array[unix::pid]>
(No description)
lib/App/ProcUtils.pm view on Meta::CPAN
This function is not exported.
Arguments ('*' denotes required arguments):
=over 4
=item * B<cmdline_match> => I<re>
(No description)
=item * B<cmdline_not_match> => I<re>
(No description)
=item * B<code> => I<code>
Code is given L<Proc::ProcessTable::Process> object, which is a hashref
containing items like C<pid>, C<uid>, etc. It should return true to mean that a
process matches.
=item * B<detail> => I<true>
Return detailed records instead of just PIDs.
=item * B<exec_match> => I<re>
(No description)
=item * B<exec_not_match> => I<re>
(No description)
=item * B<logic> => I<str> (default: "AND")
(No description)
=item * B<pids> => I<array[unix::pid]>
(No description)
( run in 0.619 second using v1.01-cache-2.11-cpan-cc502c75498 )