-
Notifications
You must be signed in to change notification settings - Fork 339
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
Allow specifying signal names for --rewrite #87
Labels
Comments
jhriggs
added a commit
to jhriggs/dumb-init
that referenced
this issue
May 13, 2020
- Adds a mapping of signal numbers to signal names based on the "most common" (subjective) signals. - This allows the same config/script to be used on different platforms, for example: -r TERM:QUIT (15:3 on Linux vs. 25:20 on OS X). - Each entry is wrapped in a #ifdef SIG<NAME>/#endif pair in an attempt to make this implementation as portable as possible. - Names can be specified with or without the SIG prefix, and numbers and names can be used in any combination: -r 15:3, -r TERM:QUIT, -r SIGTERM:3, -r TERM:SIGQUIT, etc. - Corresponding signum_to_signame() and signame_to_signum() functions were added. - A new -l/--list option shows the mapping in use on the current system/platform/OS. - Debug output has been updated to include the signal name along with the number. Fixes Yelp#87.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be nice to be able to specify
--rewrite TERM:HUP
rather than using signal numbers.Unfortunately doesn't look like there is a list of signal names available in any common headers. There's
sys_siglist
(fromstring.h
), but the names are likeHangup
andInterrupt
, rather than the short macro names that everyone uses.From looking at the
kill
source, they define an array like this:It's not the absolute worst (they're still using the signal macros, so they don't need to worry about signal numbers not matching the ordering in the file (or it being recompiled on a different architecture with different numbers)).
Is it worth it to do something like this in dumb-init? (or is there a better way?)
The text was updated successfully, but these errors were encountered: