From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 28 00:46:32 2007 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80EFE16A418 for ; Wed, 28 Nov 2007 00:46:32 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: from mail5out.barnet.com.au (mail5.barnet.com.au [202.83.178.78]) by mx1.freebsd.org (Postfix) with ESMTP id 42F6B13C461 for ; Wed, 28 Nov 2007 00:46:31 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: by mail5out.barnet.com.au (Postfix, from userid 1001) id 71E0B2219DF0; Wed, 28 Nov 2007 11:46:30 +1100 (EST) X-Viruscan-Id: <474CBA6500004CD2EAE831@BarNet> Received: from mail5auth.barnet.com.au (mail5.barnet.com.au [202.83.178.78]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail5auth.barnet.com.au", Issuer "*.barnet.com.au" (verified OK)) by mail5.barnet.com.au (Postfix) with ESMTP id 05E9421B16FB for ; Wed, 28 Nov 2007 11:46:29 +1100 (EST) Received: from k7.mavetju (k7.mavetju.org [10.251.1.18]) by mail5auth.barnet.com.au (Postfix) with ESMTP id ADA892219D4F for ; Wed, 28 Nov 2007 11:46:28 +1100 (EST) Received: by k7.mavetju (Postfix, from userid 1001) id 52AC8C9; Wed, 28 Nov 2007 11:46:28 +1100 (EST) Date: Wed, 28 Nov 2007 11:46:28 +1100 From: Edwin Groothuis To: freebsd-hackers@freebsd.org Message-ID: <20071128004628.GA42802@k7.mavetju> Mail-Followup-To: Edwin Groothuis , freebsd-hackers@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Subject: bin/118292: Add support to remove all msg/shm/sem ids with ipcrm X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2007 00:46:32 -0000 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 Edwin -- Edwin Groothuis edwin@freebsd.org http://www.mavetju.org