Skip to content

Commit

Permalink
feat: Shell.kill kill all chidren when using sigkill on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Oct 25, 2024
1 parent 1c54a86 commit 7fee410
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/process_run/lib/src/shell.dart
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,12 @@ abstract class Shell implements ShellCore, ShellCoreSync {
/// Workaround for linux when using sigkill to kill the children processes too
if (io.Platform.isLinux &&
_killedProcessSignal == ProcessSignal.sigkill) {
/// Kill the children
var pid = _currentProcess!.pid;
// Kill children process
runExecutableArgumentsSync('pkill', ['-P', '$pid']);
try {
/// Kill the children
var pid = _currentProcess!.pid;
// Kill children process
runExecutableArgumentsSync('pkill', ['-P', '$pid']);
} catch (_) {}
}

/// kill the parent process
Expand Down

0 comments on commit 7fee410

Please sign in to comment.