I will execute following command for reaping zombie
/usr/bin/preap $(ps -ef | grep defunct | grep -v grep | awk '{ print $2 }' | xargs)
Is there any service impact of this approach ?
|
|
|
If you reap a zombie before its parent, you lose whatever effect the reaping would have in the parent. This is obviously application-dependent. There is very little reason to actively go and reap zombies. Some operating systems don't let you do it, short of manually ptracing the parent process and causing it to execute a |
|||||
|
|
Your script might reap zombies too early preventing their parents to reap them and then causing unexpected behavior with them. Assuming you have no way to fix the root cause of these zombie processes existence, I would only reap those that have been in the defunct state for a long enough period of time (eg. 1 minute) to avoid bypassing legitimate reaping:
By the way, |
|||||||||||||
|