File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -403,7 +403,8 @@ sub restart {
403403sub is_running {
404404 my ($self ) = shift ;
405405 $self -> session-> consume_collected_info;
406- $self -> process_id ? kill 0 => $self -> process_id : 0;
406+ return 0 unless my $pid = $self -> process_id;
407+ kill (0, ($self -> kill_whole_group ? -$pid : $pid ));
407408}
408409
409410sub write_pidfile {
@@ -519,15 +520,16 @@ sub stop {
519520 my $pid = $self -> pid;
520521 return $self unless defined $pid ;
521522 return $self -> _shutdown(1) unless $self -> is_running;
522- $self -> _diag(" Stopping $pid " ) if DEBUG;
523523
524524 my $ret ;
525525 my $attempt = 1;
526526 my $timeout = $self -> total_sleeptime_during_kill // 0;
527527 my $sleep_time = $self -> sleeptime_during_kill;
528528 my $max_attempts = $self -> max_kill_attempts;
529529 my $signal = $self -> _default_kill_signal;
530- $pid = -getpgrp ($pid ) if $self -> kill_whole_group;
530+ $pid = -$pid if $self -> kill_whole_group;
531+ $self -> _diag(" Stopping $pid " ) if DEBUG;
532+
531533 until ((defined $ret && ($ret == $pid || $ret == -1))
532534 || ($attempt > $max_attempts && $timeout <= 0))
533535 {
You can’t perform that action at this time.
0 commit comments