Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to Process.Kill() method. #31

Merged
merged 2 commits into from
Jun 4, 2024
Merged

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Jun 4, 2024

When running processes with the capture of stdin/stdout, the Kill method will not work properly on Linux.
It seems that a child process is spawned, so it's needed to create a process group and kill the process group (that will also catch the children process).

https://groups.google.com/g/golang-nuts/c/XoQ3RhFBJl8

cmaglie added 2 commits June 4, 2024 12:19
The kill method now kills also the children processes.
@cmaglie cmaglie self-assigned this Jun 4, 2024
@cmaglie cmaglie added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jun 4, 2024
Copy link
Contributor

@alessio-perugini alessio-perugini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤯

@cmaglie cmaglie merged commit 6444974 into master Jun 4, 2024
7 checks passed
@cmaglie cmaglie deleted the kill_improvements branch June 4, 2024 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants