Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Jun 2002 14:42:30 +0200 (CEST)
From:      Oliver Fromme <olli@secnetix.de>
To:        freebsd-stable@FreeBSD.ORG
Subject:   Re: bug in pw, -STABLE [patch]
Message-ID:  <200206231242.g5NCgU146607@lurza.secnetix.de>
In-Reply-To: <20020622180011.V80651-100000@sea-incorporated.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Sorry for jumping in here ...

Geoffrey C. Speicher <geoff@sea-incorporated.com> wrote:
 > On Sat, 22 Jun 2002, Matthew D. Fuller wrote:
 > > pidmond(8); reads /etc/pidmond.conf, which contains a list of PID files
 > > and actions.  Every N-interval (in config file), scan the PID file and
 > > check if PID specified is still alive.  If not, take given action (could
 > > range from 'restart' to 'remove PID file').
 > 
 > Hmm.  This takes care of our problem, which was that pw(8) might
 > die and leave a stale pid file behind.  It also takes care of the
 > problem of automatically restarting dead daemons, though as you
 > pointed out, init(8) could be used for this too, so I'm not sure
 > what pidmond(8) gives you for daemons.

Actually, the concept of "PID files" is broken by design.
You never know for sure if a running process with PID n
is actually the one which created a PID file containing
n in the first place.  Unless the process used reliable
locking, which most programs don't do.  And even if you
can identify the process for sure, then you don't know
if it's still running or just hanging/sitting there doing
nothing (for whatever reason).

A much better approach would be to use UNIX domain sockets
instead of PID files.  That way, you could reliably check
if a daemon is still alive.  Using the kqueue mechanism,
you could even easily write a tool that restarts a daemon
instantly when it dies (well okay, init(8) can already do
that, too).  Furthermore, using a UNIX domain socket, you
can control a daemon by sending commands to and receiving
status information from it, which is much more flexible and
versatile than sending signals.  BIND already does some-
thing like that (see ndc(8)).

Alas, that would require changing almost every daemon we
have ...

Just my 0.02 Euro.

Regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"All that we see or seem is just a dream within a dream" (E. A. Poe)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




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