supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: "Laurent Bercot" <ska-supervision@skarnet.org>
To: "supervision@list.skarnet.org" <supervision@list.skarnet.org>
Subject: Re: Generic interrupt command?
Date: Sun, 10 Feb 2019 11:41:19 +0000	[thread overview]
Message-ID: <eme17a01d1-68e3-48e2-815f-b393aa59d5fc@elzian> (raw)
In-Reply-To: <CAPCpfp8QiQU_0nV2qw+kfNraww++F09yRAFfbJ=2ETi=8-6BAA@mail.gmail.com>

>That's a tough call. On the one hand, it makes simple constructs safer. 
>On the other, it adds complexity to interpreting the data 
>programmatically ( the test / [ program errors for integer comparisons 
>with text, and using scanf() to pull in the values for libc style 
>programs wouldn't be so simple anymore).

  That was my thought process originally, but if it makes it riskier
or more annoying for programs to use the result of s6-svstat,
especially in scripts which are its likely users, I'm willing to
change that.


>Also, while thinking about this, I wonder the risk of signaling the 
>wrong program. When svc does it via supervise, it can know the right 
>program gets the signal because it handles the cleaning of the child 
>PID. In a script, there is a chance the child has exited and been 
>replaced between the time the PID was queried by svstat and the time 
>the kill command gets executed. I don't know how likely a new program 
>might get the old PID in that time, this receiving the signal intended 
>for the original child.

  Well that is one of the reasons for using a supervisor in the first
place. Only the parent of a process can reliably send signals to it.
Any time you're trying to signal a program and you're not a parent,
you are subject to that risk condition. The only 100% safe way is
using s6-svc, there's no changing that.

  So far the only real need to customize a signal has been for the
signal that brings a service down, which is now achieved via
./down-signal. I haven't been told of any real use case where
sending a non-supported signal, without intending to terminate the
service, was necessary.

--
  Laurent



  reply	other threads:[~2019-02-10 11:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-02  2:36 Steve Litt
2019-02-02  9:07 ` Laurent Bercot
2019-02-02 19:30   ` Steve Litt
2019-02-02 21:08     ` Colin Booth
2019-02-02 21:40       ` Steve Litt
2019-02-05  3:09         ` John O'Meara
2019-02-05  4:15           ` Roger Pate
2019-02-05  7:20           ` Laurent Bercot
2019-02-05 14:16             ` John O'Meara
2019-02-05 19:30               ` Laurent Bercot
2019-02-10  4:14                 ` John O'Meara
2019-02-10 11:41                   ` Laurent Bercot [this message]
2019-02-02 22:31       ` Jonathan de Boyne Pollard

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=eme17a01d1-68e3-48e2-815f-b393aa59d5fc@elzian \
    --to=ska-supervision@skarnet.org \
    --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).