non-root process and PID files

Leo Bicknell bicknell at ufp.org
Mon Oct 27 09:15:03 PST 2003


In a message written on Mon, Oct 27, 2003 at 10:31:18AM -0500, Dan Langille wrote:
> Any suggestions?

Here's a slightly backwards concept.

We're all familar with how you can open a file, remove it from the
directory, and not have it "go away" until the application closes
it.  Well, extend those semantics to the namespace.

That is, have a directory where any name that does not exist can be
opened RW, any name that does exist can be opened RO.  A file is
automatically removed when no one has an open descriptor to it anymore.

So, the "server app" does:

open(pidfile)
write(pid, pidfile)
flush(pidfile)
[go do all the server stuff, and then at shutdown]
close(pidfile)

All other apps just read it, but can't overwrite it because it's
RO.

I'm not sure how useful this sort of file system change would be in
practice, but it would solve the problem, no?

-- 
       Leo Bicknell - bicknell at ufp.org - CCIE 3440
        PGP keys at http://www.ufp.org/~bicknell/
Read TMBG List - tmbg-list-request at tmbg.org, www.tmbg.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20031027/d65ffbff/attachment.bin


More information about the freebsd-hackers mailing list