How can I detect parent process death in Linux OS?
If in parent process called fork()
, that create child process. In the parent process I can use system
If both the parent and child process are under your control for their lifetime, the most portable method is to share one half of a pipe or socket with the parent.
The advantage of this method is that it completely avoids signals, which are one of the hardest to master mechanisms in UNIX, and provides a waitable descriptor that can easily be integrated with a network multiplexer or GUI event loop.