Like real zombies, zombie processes cannot be killed - they are already dead.
They will disappear when their parent process calls wait()to get their exit code, or when their parent process exits.
, Zombie. bash script , :
ps -eo uid,pid,lstart |
tail -n+2 |
while read PROC_UID PROC_PID PROC_LSTART; do
SECONDS=$[$(date +%s) - $(date -d"$PROC_LSTART" +%s)]
if [ $PROC_UID -eq 1000 -a $SECONDS -gt 600 ]; then
echo $PROC_PID
fi
done |
xargs kill
, UID 1000, 10 (600 ). , PID - , ? , - .