-
Notifications
You must be signed in to change notification settings - Fork 485
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
Feature: Make kill signal configurable #871
Conversation
This also makes it possible to use Like this: exec:
signal: sigint
streams:
canon: exec:gphoto2 --capture-movie --stdout |
I don't think this is good idea to use same kill signal for all exec sources. It should be |
Good point, I'm gonna fix it |
The process may not terminating upon receipt of sigint. It's important to implement some timeout, after which sigkill will be sent. Otherwise, zombie processes may appear |
Better? @AlexxIT |
What happens if anyone set #killtimeout to zero or negative number? ;) UPD: oops, looks like, that nothing bad |
UPD: Negative or zero number will result in an immediate SIGKILL. |
Is there anything I can work on to make this PR more acceptable? |
Sorry. Don't have time to review. Fixing my other projects after Home Assistant 2024.1 update... |
Just realized this could make problems on windows/darwin. Need to invest some time in os specific code.. |
5395454
to
c566d05
Compare
This should work.. |
Thanks! I've rewritten the code to make it simpler. |
I would probably change the default behavior, instead of killing by default, sending SIGTERM and waiting some arbitrary time like 5 seconds before killing the process. |
For example, ffmpeg will fail in any way, because stdout will be closed before kill signal. |
This makes it possible to end
exec
commands gracefully.Also fixed a typo on the way :)
Fixes #870