Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Oct 2003 12:15:00 -0500
From:      Leo Bicknell <bicknell@ufp.org>
To:        freebsd-hackers@freebsd.org
Subject:   Re: non-root process and PID files
Message-ID:  <20031027171500.GF35805@ussenterprise.ufp.org>
In-Reply-To: <3F9CF3F6.8307.ABC1250@localhost>
References:  <3F9CF3F6.8307.ABC1250@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help

--9ADF8FXzFeE7X4jE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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?

--=20
       Leo Bicknell - bicknell@ufp.org - CCIE 3440
        PGP keys at http://www.ufp.org/~bicknell/
Read TMBG List - tmbg-list-request@tmbg.org, www.tmbg.org

--9ADF8FXzFeE7X4jE
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE/nVKUNh6mMG5yMTYRAqn1AJ0XWbUmf1K1bKTHxbYqe5ONd/zE1QCfT2jy
cwojcT3QB2Es0OzEaUK2tOw=
=a6WR
-----END PGP SIGNATURE-----

--9ADF8FXzFeE7X4jE--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031027171500.GF35805>