From owner-freebsd-questions@FreeBSD.ORG Thu Jun 10 17:25:24 2010 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A45C1065672 for ; Thu, 10 Jun 2010 17:25:24 +0000 (UTC) (envelope-from bonomi@mail.r-bonomi.com) Received: from mail.r-bonomi.com (ns2.r-bonomi.com [204.87.227.129]) by mx1.freebsd.org (Postfix) with ESMTP id EF6758FC1A for ; Thu, 10 Jun 2010 17:25:23 +0000 (UTC) Received: (from bonomi@localhost) by mail.r-bonomi.com (8.14.3/rdb1) id o5AHOtuT009189; Thu, 10 Jun 2010 12:24:55 -0500 (CDT) Date: Thu, 10 Jun 2010 12:24:55 -0500 (CDT) From: Robert Bonomi Message-Id: <201006101724.o5AHOtuT009189@mail.r-bonomi.com> To: lists@eitanadler.com, questions@freebsd.org Cc: Subject: Re: Too many defunct processes; kill -9 not working X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 17:25:24 -0000 > From owner-freebsd-questions@freebsd.org Wed Jun 9 06:09:36 2010 > From: Eitan Adler > Date: Wed, 9 Jun 2010 14:08:58 +0300 > To: questions@freebsd.org > Cc: > Subject: Too many defunct processes; kill -9 not working > > Lately I've been getting a considerable number of defunct processes. I > do not know of any major event that changed my computer (ie it is not > related to an ports update or a freeBSD upgrade). > > This is often caused by me killing the process using kill -15 or kill > -3 or kill -9. > > What can I do to determine why processes are not getting killed by kill -9? > > % ps -o ppid -o comm|grep defunct|cut -d ' ' -f 1 |xargs kill -9 > typically gets rid of them (by killing their parent) A 'defunct' process _has_ been killed. What you see is the 'remains' of the dead process, because the parent process has not yet 'reaped' the exit status of the dead child. All the resources of the child have been released, _except_ for the job- table slot entry. THAT is needed because that is where the child's exit status is kept.