jayjun / rambo

Run your command. Send input. Get output.
MIT License
202 stars 22 forks source link

Issue when terminating long-running process #7

Closed benvp closed 3 years ago

benvp commented 3 years ago

Hey, I have a long running process which get's killed after a certain amount of time automatically. The process get's correctly killed on the system, but somehow it doesn't allow the system process to do it's cleanup. How does rambo end the system processes when calling kill? The process in my case is parec which records system audio. However, when the process is killed by rambo the recording doesn't work as the parec doesn't seem to have enough time to end the recording properly (which it does if SIGINT, SIGTERM is being sent.). Any idea? I didn't really find anything which points in the right direction while browsing the code.

jayjun commented 3 years ago

Underneath, Rambo uses Rust’s Child::kill which does a SIGKILL.

When the Rust standard library or a cross-platform (including Windows) Cargo package supports SIGTERM, I can add it.

This is one of the reasons I do not recommend Rambo for long-running processes. Check out the README for alternatives.