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

trap scripts called multiple times #196

Open
ddiss opened this issue Dec 5, 2022 · 0 comments
Open

trap scripts called multiple times #196

ddiss opened this issue Dec 5, 2022 · 0 comments

Comments

@ddiss
Copy link
Collaborator

ddiss commented Dec 5, 2022

We have a whole bunch of trap "$script" 0 1 2 3 15 callers, where $script is unintentionally invoked multiple times. Either the trap handler should be cleared, or the signal list should be trimmed to e.g. only 0, so that a SIGINT invocation won't be followed by a second for EXIT.

ddiss added a commit that referenced this issue Jul 12, 2024
trap is used in many places to cleanup on unexpected (e.g. SIGINT) or
expected script exit. Specifying 0 (EXIT) alongside other signals for
trap means that signal handlers can be invoked multiple times, e.g. once
for a SIGINT and again for subsequent EXIT. For cleanup we're really
only interested in the EXIT event, so remove all other signals.

Link: #196
Signed-off-by: David Disseldorp <ddiss@suse.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant