sigmap
Map Unix signals on the way to a child process
TLDR
SYNOPSIS
sigmap -m from:to [-m from:to ...] program [arguments]
DESCRIPTION
sigmap is a small wrapper that launches a child process and rewrites the signals delivered to it. The wrapper installs a handler for each from signal listed on the command line; when the host kernel delivers from to sigmap, the wrapper instead sends the corresponding to signal to the child. Signals not listed pass through unchanged.This is useful when one process insists on emitting a signal that the wrapped program does not understand, when bridging between shells and applications that disagree on which signal means "reload", or when adapting legacy software to a different supervisor. Because the rewrite happens entirely in the wrapper, the child process sees only the translated signals and needs no modification.sigmap uses execve(2) to spawn the child, so the resolved binary must be a real executable file with a full path. Shell built-ins, aliases, and bare program names that rely on PATH will not work.
PARAMETERS
-m from:to, --map=from:to
Translate signal from into signal to when forwarding to the child process. Both values are integer signal numbers as listed in signal(7). The option may be repeated to install multiple mappings.program
Path to the executable to launch. Because sigmap uses execve(2), this must be an absolute or relative path; PATH lookup is not performed.arguments
Forwarded unchanged to the launched program.
EXAMPLES
Make a SIGTERM act like a graceful SIGHUP reload for a daemon:
CAVEATS
Signal numbers are not portable across architectures; SIGUSR1 is 10 on x86 Linux but 30 on Alpha. Always check signal(7) on the target platform before hardcoding numeric values. Real-time signals (SIGRTMIN+n) can be remapped but the numeric value depends on the C library. SIGKILL (9) and SIGSTOP (19) cannot be caught and therefore cannot be remapped.
HISTORY
sigmap is an open-source utility published by Martin Jacobsson on GitHub as a minimal Unix signals converter. It is intentionally small and depends only on a POSIX C runtime, making it easy to drop into containers and minimal init systems.
