I am developing an application and I would like it to print some runtime stats to the console on demand.
kill and signals came to my mind immediately.
Reading through Unix signals on Wiki,
SIGINFO seems like the way to go because:
- It is intended for these purposes
- Does not terminate the process if the signal handler is not implemented (contrary to
SIGUSRx- see here)
However, by inspecting the output of
kill -l, it seems my server does not have this signal implemented.
My questions are:
- Why is
SIGINFOmissing on my system? Is it absent on all GNU Linux systems?
- Is there an easy (i.e. no kernel/glibc recompilation) way to enable this signal? If none, what would be the hard way?
- What alternative signal could I use for my purposes that would not cause any side-effects if not handled by the target process? (I already assume none since I could not find any other suitable signal on the glibc's manual)
Linux whatever 3.18.2-2-ARCH #1 SMP PREEMPT Fri Jan 9 07:37:51 CET 2015 x86_64 GNU/Linux
Update: I am still looking for more information as to why this signal is conditionally excluded from other systems than BSD (see comments below). The signal seems to be quite useful for many purposes so it is hard for me to believe it is just a matter of whim - so what's the real showstopper for this signal to be available on Linux?