From owner-freebsd-arch@FreeBSD.ORG Mon Dec 10 14:37:01 2007 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 894ED16A41A; Mon, 10 Dec 2007 14:37:01 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from mrout1.yahoo.com (mrout1.yahoo.com [216.145.54.171]) by mx1.freebsd.org (Postfix) with ESMTP id 7769513C442; Mon, 10 Dec 2007 14:37:01 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from minion.local.neville-neil.com (proxy7.corp.yahoo.com [216.145.48.98]) by mrout1.yahoo.com (8.13.6/8.13.6/y.out) with ESMTP id lBAEQYTo030328; Mon, 10 Dec 2007 06:26:34 -0800 (PST) Date: Mon, 10 Dec 2007 09:26:34 -0500 Message-ID: From: gnn@freebsd.org To: Edwin Groothuis In-Reply-To: <20071209223042.GA40965@k7.mavetju> References: <20071209223042.GA40965@k7.mavetju> User-Agent: Wanderlust/2.15.5 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.7 Emacs/22.1.50 (i386-apple-darwin8.10.1) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: arch@freebsd.org Subject: Re: bin/118292: Add support to remove all msg/shm/sem ids with ipcrm X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2007 14:37:01 -0000 At Mon, 10 Dec 2007 09:30:42 +1100, Edwin Groothuis wrote: > > Hello, > > A friend of me has submitted this PR and I promised him that I would > see if I could get it implemented. I couldn't find anybody directly > responsible for the ips/iprcm tools, so I throw it in here for > discussion. > > >Description: > > I've observed that linux apps running under the linuxulator > have a habit of leaving behind shared memory segments which are > unused, but which eventually cause the system to run out of > free segments and these apps will stop working. ipcrm(1) currently > only allows removal of unused message queues, shared memory > segments and semaphores on an individual basis, or those having > a matching (non-zero) key. However it would often be convenient > to just do a complete cleanup of everything, usually as root. > > The attached patch allows removal of all message queues, shared > memory segments or semaphores by specifying an id of -1 (ala > kill(2)). The code to lookup ids was taken from ipcs. > > The patch is available in http://www.freebsd.org/cgi/query-pr.cgi?pr=118292 > > I will do it in two parts (according to the wishes of my mentor): > First style(9)ify ipcrm.c, then the patch. > > If anybody has a good observation on this change, please speak up now. > I have not read the patch in detail but I like the idea, we should be able to easily clean such things up. Best, George