Handle SIGTERM and SIGINT for clean exit#317
Merged
v1cont merged 1 commit intov1cont:masterfrom Dec 3, 2025
Merged
Conversation
Adds handlers for SIGTERM and SIGINT signals using the existing sa_usr2() handler, which cleanly exits with YAD_RESPONSE_CANCEL. This allows scripts to properly terminate YAD dialogs when interrupted (Ctrl+C) or when receiving SIGTERM from process managers. Follows feedback from PR v1cont#314 about reusing existing handlers instead of creating new ones.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Handle SIGTERM and SIGINT for clean exit
Adds signal handlers for SIGTERM and SIGINT using the existing
sa_usr2()handler. Follows the feedback on PR #314 about reusing existing handlers.What changed
Two lines added to the signal handler setup:
The existing
sa_usr2()handler exits withYAD_RESPONSE_CANCEL, which is the appropriate response for interrupted dialogs.Why
Scripts embedding YAD dialogs need to properly terminate them when interrupted or receiving signals from process managers. Without this, SIGTERM and SIGINT would use the default behavior (immediate termination) instead of the clean exit path.
Testing