/var/run/ pid files

Jerry McAllister jerrymc at clunix.cl.msu.edu
Thu Jul 17 06:58:02 PDT 2003


> 
> 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
> 


More information about the freebsd-questions mailing list