-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
killall command fails with: no can_run function in Process.pm #1548
Comments
Editing I can submit that PR if the bug is approved. sub killall {
my ( $process, $sig ) = @_;
$sig ||= "";
if ( Rex::Commands::Run::can_run("killall") ) { # PREFIXED: by module
i_run( "killall $sig $process", fail_ok => 1 );
if ( $? != 0 ) {
die("Error killing $process");
}
}
else {
die("Can't execute killall.");
}
} |
Thanks for the report!
A proper PR would include tests too, but we can't easily call |
Since it can't be tested, is it okay if I submit PR with the suggestion above? (ie. prefixing the function with |
It can be tested in multiple ways, I'm just not sure which way is the best going forward yet, whether others already published useful work we can reuse, and extra care must be taken to not accidentally My ideas so far:
|
Describe the bug
Running
killall
command on a FreeBSD server results in:killall
is defined as follows:Seems like there's no
can_run
function inProcess.pm
module.Expected behavior
killing process by name successfully
How to reproduce it
Run the code example.
Code example
Additional context
I tested, and the same error occured locally on Debian Linux as well.
Rex version
1.13.4
Perl version
5.36.0
Operating system running rex
Debian
Operating system managed by rex
FreeBSD
How rex was installed?
cpan client
The text was updated successfully, but these errors were encountered: