How to find who sends a sigmmer signal to my process or my process group?

We have a daemon server program that deploys one child. When the baby leaves, the parent receives a signal SIGTERM. So we want to know

1) Who sent this SIGTERM?

2) Is it SIGTERMonly for the parent or his group?

3) What are the possible ways that SIGTERMcan be generated in this scenario?

4) Is it possible to mask this signal SIGTERM? If so, what will be the side effect of this call?

+3
source share
2 answers

sig- SA_SIGINFO. siginfo_t, si_pid, . http://linux.die.net/man/2/sigaction

+5

@rib:

strace ,

read(0, 0x7f4ab8353000, 4096)           = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=1, si_uid=0} ---
+++ killed by SIGTERM +++

, pid # 1 (init, .. )

p.s. CentOS (6.0 6.4) , http://sourceforge.net/projects/strace/, ,

+4

Source: https://habr.com/ru/post/1772652/


All Articles