Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Child process detecting the parent process' death in Python

Is there a way for a child process in Python to detect if the parent process has died?

like image 595
Evan Fosmark Avatar asked Apr 17 '09 07:04

Evan Fosmark


1 Answers

If your Python process is running under Linux, and the prctl() system call is exposed, you can use the answer here.

This can cause a signal to be sent to the child when the parent process dies.

like image 103
Alnitak Avatar answered Oct 21 '22 17:10

Alnitak