IsInitProcess returns true if the current process's PID is 1.
()
| 16 | |
| 17 | // IsInitProcess returns true if the current process's PID is 1. |
| 18 | func IsInitProcess() bool { |
| 19 | return os.Getpid() == 1 |
| 20 | } |
| 21 | |
| 22 | // startSignalForwarding registers signal handlers synchronously |
| 23 | // then forwards caught signals to the child in a background |