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

fix(external command): Create the new shell process in a new group #96

Merged
merged 5 commits into from
Sep 20, 2021

Conversation

mariocynicys
Copy link
Contributor

@mariocynicys mariocynicys commented Sep 20, 2021

When launching a process as a shell, what happens is that Popen creates a shell then the shell forks itself and calls exev system call to run the program we intended to run in the shell.

Popen
  |
  V
shell -fork-> another-shell
  |                 |
  V                exev
                    |
                    V
              external-command

We have access to the shell it self from self._process which we actually don't need. We need the pid of external-command instead.

This PR launches the spawned shell in a new group so that we can just kill the group all together when stop is called.

fixes #46

@joeyparrish joeyparrish merged commit 19e8652 into shaka-project:master Sep 20, 2021
@joeyparrish
Copy link
Member

Thank you!

@mariocynicys mariocynicys deleted the orphan_process branch September 27, 2021 13:41
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Orphaned subprocesses after shutting down with CTRL+C
2 participants