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

Support kill_on_drop(false) on Windows #17

Closed
arlyon opened this issue Feb 28, 2023 · 3 comments
Closed

Support kill_on_drop(false) on Windows #17

arlyon opened this issue Feb 28, 2023 · 3 comments

Comments

@arlyon
Copy link
Contributor

arlyon commented Feb 28, 2023

Hi! I am interested in using this lib to start cross-platform daemons on win / unix. As I understand it, in this case, we should be able to avoid setting the flag here:

https://github.com/watchexec/command-group/blob/main/src/winres.rs#L89

I assume that this is not implemented due to kill_on_drop being private?

Seems to be a similar problem to #15

@arlyon
Copy link
Contributor Author

arlyon commented Feb 28, 2023

I would like to suggest as an alternative to both of these that the library handles the setting of these parameters on its own builder. I'm a little bit hesitant because it could lead to some awkward footguns, if, for example, someone sets kill_on_drop before converting it to a group builder... however, my thought would be:

let mut group = tokio::process::Command::new(path)
    .arg("daemon")
    .stderr(Stdio::null())
    .stdout(Stdio::null())
    .group() // converts it to a group builder
    .kill_on_drop(false)
    .spawn()?;

Happy to open a PR, though I realize this is a major breaking change...

@passcod
Copy link
Member

passcod commented Feb 28, 2023

Not necessarily a breaking change, if both group() and group_spawn() are supported. I'm keen, I think that would then make it elegant to support e.g. setting process flags for #15

@arlyon
Copy link
Contributor Author

arlyon commented Feb 28, 2023

Thanks for the quick reply, I'll get a PR up soon :)

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

No branches or pull requests

2 participants