From owner-freebsd-questions@FreeBSD.ORG Thu Jul 17 06:58:02 2003 Return-Path: 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 5A54137B401 for ; Thu, 17 Jul 2003 06:58:02 -0700 (PDT) Received: from clunix.cl.msu.edu (clunix.cl.msu.edu [35.9.2.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8B2A043FDF for ; Thu, 17 Jul 2003 06:58:01 -0700 (PDT) (envelope-from jerrymc@clunix.cl.msu.edu) Received: from clunix.cl.msu.edu (localhost [127.0.0.1]) by clunix.cl.msu.edu (8.12.9/8.12.9) with ESMTP id h6HDvxOg001785; Thu, 17 Jul 2003 09:57:59 -0400 (EDT) Received: (from jerrymc@localhost) by clunix.cl.msu.edu (8.12.9/8.12.9/Submit) id h6HDvx1p001784; Thu, 17 Jul 2003 09:57:59 -0400 (EDT) From: Jerry McAllister Message-Id: <200307171357.h6HDvx1p001784@clunix.cl.msu.edu> To: bmwz3@attglobal.net Date: Thu, 17 Jul 2003 09:57:58 -0400 (EDT) In-Reply-To: <20030717013753.4E90843F85@mx1.FreeBSD.org> from "Ronny Hippler" at Jul 16, 2003 09:37:51 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd questions Subject: Re: /var/run/ pid files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2003 13:58:02 -0000 > > On Wed, 16 Jul 2003 21:31:47 +0100, lewiz wrote: > > >> What controls the creation of the pid files in the /var/run/ directory?= > >afaik, sometimes you have to create them yourself. Some programmes > >don't have an option to create one. This can be done easily using a > >combination of ps, grep and awk ;) There's probably a more professional > >way of doing it, but I don't know (I'd be interested to hear though ;) > > Wonder what is creating that directory then? Do you mean the '/var/run' directory? That is put there on initial install I am sure. You should already have one if you have installed FreeBSD, at least any recent version. Programs write their own PID files, almost all of them in /var/run, though there is nothing forcing them to do so. A program could either not do it or put it anywhere they have write access. So, whoever writes/maintains the program puts in code to save the PID to a file. The code is either within the program or some monkey business done in the startup script. Most programs that write PID files also have some sort of config file that is read upon startup and the location of the PID file, amongst other things is usually specified in that config file with the default most often being /var/run/progname.pid. Doesn't that about tell all you need to know on this? The rest is in the code for each specific program. ////jerry > > -- > > Bugs come in through open Windows. > > > Ronny Hippler || Spartanburg SC > http://www.vr5.dyndns.org:8008/ || ftp://ftp.vr5.dyndns.org:2112/ > For PGP key email with "PGPKey" in the subject >