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

Ctrl+C should be handled and terminate us at the nearest safe point #41

Closed
Hoverbear opened this issue Nov 8, 2022 · 2 comments · Fixed by #63
Closed

Ctrl+C should be handled and terminate us at the nearest safe point #41

Hoverbear opened this issue Nov 8, 2022 · 2 comments · Fixed by #63
Assignees

Comments

@Hoverbear
Copy link
Contributor

While running an install/uninstall, we should be capturing any signals what would cause us to stop and delaying stopping until we are at the next place we mark an Action completed, so that if the user resumes or uninstalls we are still keeping their system clean.

@Hoverbear
Copy link
Contributor Author

Right now if we are running some tokio::process::Command and the user CTRL+C's the signal will get sent to the entire process group, it seems the solution to this is to use setsid (https://docs.rs/nix/latest/nix/unistd/fn.setsid.html) and process_group (https://doc.rust-lang.org/std/os/unix/process/trait.CommandExt.html#tymethod.process_group) to create a new process group which is lead by harmonic, this way it can feed them signals as desired without the user being involved.

This is added to Tokio so we just need to wait for a release: tokio-rs/tokio#5114

@Hoverbear
Copy link
Contributor Author

New Tokio release, so this can get completed.

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 a pull request may close this issue.

1 participant