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

Add SIGHUP termination signal to watchmedo #912

Merged
merged 2 commits into from Aug 13, 2022

Conversation

babymastodon
Copy link
Contributor

@babymastodon babymastodon commented Aug 12, 2022

This PR registers SIGHUP as a termination signal for watchmedo. This is important for people who use watchmedo within terminal multiplexers such as tmux, as tmux causes all shells to send the SIGHUP signal when the session is closed. Since watchmedo ignores the SIGHUP handler, this causes the watchmedo process to continue running in the background, even though the shell running within tmux has been terminated.

As a workaround, I am working on writing a bash script that will convert the SIGHUP into a SIGINT before forwarding to watchmedo. However, I think it would be more intuitive for users if watchmedo would gracefully shut down when receiving SIGHUP in the first place.

@babymastodon babymastodon changed the title Add SIGHUP handler to watchmedo Add SIGHUP termination signal to watchmedo Aug 12, 2022
@BoboTiG
Copy link
Collaborator

BoboTiG commented Aug 12, 2022

Thanks @babymastodon !

That's a good idea 👍

Would you mind adding a line in the changelog + your GitHun nickname?

@babymastodon
Copy link
Contributor Author

Thanks for looking @BoboTiG . I updated the changelog. Does it look okay?

@BoboTiG
Copy link
Collaborator

BoboTiG commented Aug 13, 2022

Thanks for looking @BoboTiG . I updated the changelog. Does it look okay?

Perfect, thanks!

@BoboTiG BoboTiG merged commit 21e9f4c into gorakhargosh:master Aug 13, 2022
20 of 23 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants