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

Linux: renable use of process groups #8009

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mook-as
Copy link
Contributor

@mook-as mook-as commented Dec 25, 2024

This adds code to manually set a process group on Linux only, and to re-enable the use of process groups to terminate processes on shutdown.

Fixes #7653

On Linux, manually set the process group for the main Electron process to
its pid so that we can use it to terminate any processes we spawn as part
of extensions.

Note that this happens after Electron has started other processes; hence
some of the Electron-internal processes will have the old process group.
This is not an issue as they will go away once the main process does.

Signed-off-by: Mark Yen <[email protected]>
@mook-as mook-as force-pushed the linux/process-groups branch 2 times, most recently from 5f5de3d to 7e37a06 Compare January 2, 2025 19:48
Check the process group of the target pid when killing it; if it matches
the pid (i.e., the process is the leader of its own group), it is safe to
kill the whole group instead of just the main process.

Signed-off-by: Mark Yen <[email protected]>
@mook-as mook-as force-pushed the linux/process-groups branch from 7e37a06 to 4f391f6 Compare January 2, 2025 20:03
@mook-as mook-as marked this pull request as ready for review January 2, 2025 20:39
@mook-as mook-as requested a review from jandubois January 7, 2025 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Factory reset: stop all child processes
1 participant