#Child process not exiting when main process exits
13 messages · Page 1 of 1 (latest)
is the command's process not killed or just some child of that process?
To explain what i mean, pyinstaller in (single-file mode) spawns 2 process and on exit only one is killed (because pyinstaller can't clean up after itself apparently
)
the command's process i think? i'm running the tor executable
okay then maybe both options. tor will spawn multiple processes too and i'm not sure if it cleans them all up 🤔
but one after another i guess.
tauri uses process.exit() to close the app which prevents Drop implementations from being executed. In other words, you have to manually kill the child in the Exit event. Or maybe try tauri's Command first, it should kill them automatically on exit.
https://docs.rs/tauri/latest/tauri/api/process/struct.Command.html
If there are still left over processes after trying either one of these options then it's likely we're having to deal with orphaned child process, which typically means using https://docs.rs/command-group/latest/command_group/
tauri's command is called from the frontend though?
not sure what you mean
tauri::api::process::Command doesn't exist
it needs the process-command-api feature flag (which can only be enabled by enabling part of the "shell" allowlist in tauri.conf.json, otherwise tauri's cli will just remove the cargo feature flag again)