From owner-freebsd-questions Fri Jul 5 6:45:51 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 629C437B400 for ; Fri, 5 Jul 2002 06:45:49 -0700 (PDT) Received: from catflap.home.slightlystrange.org (host217-39-46-78.in-addr.btopenworld.com [217.39.46.78]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4111843E31 for ; Fri, 5 Jul 2002 06:45:48 -0700 (PDT) (envelope-from danielby@home.slightlystrange.org) Received: from danielby by catflap.home.slightlystrange.org with local (Exim 3.36 #1) id 17QTP8-0009GK-00 for questions@freebsd.org; Fri, 05 Jul 2002 14:45:46 +0100 Date: Fri, 5 Jul 2002 14:45:46 +0100 From: Daniel Bye To: questions@freebsd.org Subject: Re: Limiting users Message-ID: <20020705134546.GB34546@catflap.home.slightlystrange.or> Reply-To: dan@slightlystrange.org Mail-Followup-To: questions@freebsd.org References: <000501c22355$38743f50$4acea3ca@hobbes> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000501c22355$38743f50$4acea3ca@hobbes> User-Agent: Mutt/1.4i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Jul 04, 2002 at 08:20:43PM +0800, dnu wrote: > Hello, > > A number of my users run a bouncer. But when they make changes > to the config file, they start up another instance of the bouncer > w/o killing the old one that's already running in the background. > > Is there a way to limit them to only one background process? > Unfortunately, this may also prevent other programs - like man - > from functioning properly. > > I guess my question now is how do I keep users from running > multiple instances of the same program? Without having to do the > killing myself, of course. :) > You could probably write a wrapper script for it - get the wrapper to write a pidfile, or something, and check for one each time a new process is started. It can then either kill the existing process and start a new one, or simply complain so the user has to do it. You will need to make sure the pidfile gets refreshed, or you will find yourself taking lots of calls about their processes not working... ;-) Just a thought, but it might work. Dan -- Daniel Bye PGP Key: ftp://ftp.slightlystrange.org/pgpkey/dan.asc PGP Key fingerprint: 3D73 AF47 D448 C5CA 88B4 0DCF 849C 1C33 3C48 2CDC _ ASCII ribbon campaign ( ) - against HTML, vCards and X - proprietary attachments in e-mail / \ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message