Custom plugins may spawn zombie processes, such as:
# in NPD container
Z Wed Nov 30 23:38:18 2022 netwo <defunct> 1221841
Z Wed Nov 30 23:38:46 2022 netwo <defunct> 1223132
Z Wed Nov 30 23:38:47 2022 check <defunct> 1223134
Z Wed Nov 30 23:38:49 2022 netwo <defunct> 1223183
Z Wed Nov 30 23:38:53 2022 check <defunct> 1223378
Z Wed Nov 30 23:39:48 2022 netwo <defunct> 1225778
I found NPD spawn the bash process, and bash spawn a sub process because of conntrack_count=$(< $CT_COUNT_PATH).
If the system load is so high or some thing else, the first bash process is timeout and killed by NPD and the sub bash would be killed by SIGPIPE. NPD will call wait4 with pid of bash process, but never wait the sub bash process.
So should we let NPD regularly recycle zombie processes to avoid system crashes?
Custom plugins may spawn zombie processes, such as:
network_problem.sh is an official plugin.
I try to debug it with strace and execsnoop.
I found NPD spawn the bash process, and bash spawn a sub process because of conntrack_count=$(< $CT_COUNT_PATH). If the system load is so high or some thing else, the first bash process is timeout and killed by NPD and the sub bash would be killed by SIGPIPE. NPD will call wait4 with pid of bash process, but never wait the sub bash process.
So should we let NPD regularly recycle zombie processes to avoid system crashes?