I'm trying to debug an issue with my shell (specifically,
fish) sending signals to my background processes. I'd like to be able to recognize what signals a process is receiving.
Ideally, I'd like some program that would do something like this:
$ log_signals > signals.txt &
Which would then write the signals it received to its output. However, I don't believe any such program readily exists.
What's the simplest way to trap incoming signals and inspect them, preferably without needing to write my own program?
(I'm running OS X, not Linux, so I'd prefer a more platform-agnostic answer if possible.)