Environment:
I have a python server which forks into 3 children.
For the parent:
- SIGTERM is supposed to kill all children and SIGHUP is just supposed to log and exist
For the child:
- Both SIGTERM and SIGHUP maps to SIG_DFL
Problem:
When I start the script through command line python <script.py>
, and send SIGHUP to parent kill -1 <pid-of-parent>
it behaves well. The parent exits and busy children exit only after completing their I/Os.
But if the same script is started with systemd script, when I send SIGHUP to parent, the children which are still busy receive a SIGTERM and result in disrupted I/O.
Any explanation/solutions for this ? Is it some misconfiguration ?