supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: prj@po.cwru.edu (Paul Jarc)
Cc: supervision@list.skarnet.org
Subject: Re: graceful restart under runit
Date: Fri, 24 Nov 2006 16:22:11 -0500	[thread overview]
Message-ID: <m3slg88rqd.fsf@multivac.cwru.edu> (raw)
In-Reply-To: <20061123122557.GA17067@fly.srk.fer.hr> (=?iso-8859-2?Q?Dra?= =?iso-8859-2?Q?=BEen_Ka=E8ar's?= message of "Thu, 23 Nov 2006 13:25:57 +0100")

Dražen Kačar <dave@fly.srk.fer.hr> wrote:
> PIDs are not recycled fast in practice, so that would have to be
> good enough.

They certainly are recycled fast in practice, although maybe not
often.  For example, OpenBSD can assign PIDs in random order instead
of sequentially, so a PID has a chance of being reused for the very
next process after it exits.  The same problem can hit any OS if it
spawns short-lived processes at a high rate.

For me, at least, it's well worth using poll()/select() to avoid this
risk.  It's a one-time task for the programmer, but PID recycling is a
constant danger for every user.

> Somewhat unportable guarantee could be obtained via /proc.  You know the
> PID, so you stop the process via /proc or ptrace() or whatever is
> available for debuggers (something will be available), check that the PID
> is associated with the correct executable via /proc,

Even if it's the right program, that doesn't guarantee it's the right
process.  This seems like more work than poll()/select(), with worse
results.


paul


  reply	other threads:[~2006-11-24 21:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-15 11:47 Dražen Kačar
2006-11-15 16:08 ` Alex Efros
2006-11-16 15:24   ` Dražen Kačar
2006-11-17  0:15     ` Alex Efros
2006-11-17  0:48       ` Paul Jarc
2006-11-17 13:34         ` Alex Efros
2006-11-17 14:53           ` Charlie Brady
2006-11-17 15:39             ` Gerrit Pape
2006-11-18  0:22             ` Alex Efros
2006-11-18  1:34               ` Charlie Brady
2006-11-18 12:31                 ` Alex Efros
2006-11-18 19:30                   ` Paul Jarc
2006-11-20 18:27                     ` Dražen Kačar
2006-11-20 19:32                       ` Paul Jarc
2006-11-20 19:43                         ` Paul Jarc
2006-11-22 19:25                         ` Dražen Kačar
2006-11-22 19:51                           ` Paul Jarc
2006-11-23 12:25                             ` Dražen Kačar
2006-11-24 21:22                               ` Paul Jarc [this message]
2006-11-17 13:14     ` Gerrit Pape

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3slg88rqd.fsf@multivac.cwru.edu \
    --to=prj@po.cwru.edu \
    --cc=supervision@list.skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).