There are ways to do some work with linux signal handlers
.
- We can either register system handlers for every signals (if we have sourcecode) or
- Run the process under
strace
to view them.
Stratergy 1:
But if we dont have source code, how can we catch a signals
to an application to do something with it and return back? (not a one time debugging but permanent feature). [may be hack a system call
?]
Stratergy 2:
And in case we do have source code, is writing to a file safe in case of multiple signals ? or is it more safe to execute signal handler in a fork()
process and discard SIGCHLD
? what happens if another signals comes in when handling previous signal?