-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Create a tokio::process::Child in a new process group #4312
Comments
Thoughts @ipetkov ? |
Unfortunately, I think this is the only way to accomplish this. We pretty much wrap the stdlib types, and there aren't any OS extensions that I could find which do the |
Would it help if I propose this extension in the stdlib? |
It's worth a shot! We don't need to wait on the stdlib to potentially add such a wrapper, but having the feature parity would be nice |
The stdlib has |
Looks like |
I think next steps for this are:
|
Rust 1.64 stabilised the `process_group` method of the `std::os::unix::process::CommandExt` trait. This allows the caller to set the process group that a command is spawned in. Expose that functionality from Tokio's `Command` structure. This fixes tokio-rs#4312.
Rust 1.64 stabilised the `process_group` method of the `std::os::unix::process::CommandExt` trait. This allows the caller to set the process group that a command is spawned in. Expose that functionality from Tokio's `Command` structure. This fixes tokio-rs#4312.
Rust 1.64 stabilised the `process_group` method of the `std::os::unix::process::CommandExt` trait. This allows the caller to set the process group that a command is spawned in. Expose that functionality from Tokio's `Command` structure. This fixes tokio-rs#4312.
Rust 1.64 stabilised the `process_group` method of the `std::os::unix::process::CommandExt` trait. This allows the caller to set the process group that a command is spawned in. Expose that functionality from Tokio's `Command` structure. This fixes tokio-rs#4312.
Rust 1.64 stabilised the `process_group` method of the `std::os::unix::process::CommandExt` trait. This allows the caller to set the process group that a command is spawned in. Expose that functionality from Tokio's `Command` structure. This fixes tokio-rs#4312.
Rust 1.64 stabilised the `process_group` method of the `std::os::unix::process::CommandExt` trait. This allows the caller to set the process group that a command is spawned in. Expose that functionality from Tokio's `Command` structure, behind the unstable feature. This fixes tokio-rs#4312.
Rust 1.64 stabilised the `process_group` method of the `std::os::unix::process::CommandExt` trait. This allows the caller to set the process group that a command is spawned in. Expose that functionality from Tokio's `Command` structure, behind the unstable feature. This fixes tokio-rs#4312.
Rust 1.64 stabilised the `process_group` method of the `std::os::unix::process::CommandExt` trait. This allows the caller to set the process group that a command is spawned in. Expose that functionality from Tokio's `Command` structure, behind the unstable feature. This fixes tokio-rs#4312.
Is your feature request related to a problem? Please describe.
I want to create a child process and later be able to kill this child with all of it's sub- and sub-sub- children on unix-style operating systems.
Describe the solution you'd like
Something along the lines of:
.set_process_group(0)
Describe alternatives you've considered
I'm currently using this code to implement it:
setpgid
needs to be called beforeexec
is called afterfork
.Additional context
https://www.gnu.org/software/libc/manual/html_node/Process-Group-Functions.html
The text was updated successfully, but these errors were encountered: