supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Xavier Stonestreet <xstonestreet@gmail.com>
To: supervision@list.skarnet.org
Subject: Re: s6-permafailon not acting as expected
Date: Tue, 17 Nov 2020 21:06:03 +0100	[thread overview]
Message-ID: <CAK-rGMJbxUJAcjmgh3vd2kNrTG0T-QciAerTtrqxLh+prY5vkA@mail.gmail.com> (raw)
In-Reply-To: <CAK-rGMJGsM2oNgZ0tiS83G8bSZZRdyTk0BLRVPpzn1xrUuE-mA@mail.gmail.com>

Upon further investigation, it turns out my events filter is
incorrect, because exit codes greater than 128 imply that the service
has been killed by a signal (128 + signal number), so the exit code
range 1-255 actually means exit codes 1 to 127 or any signal.

The correct specification for my example is 1-127,SIGBUS,SIGSEGV.

I believe a call to sigemptyset() in s6-permafailon.c may still be
warranted however, because the POSIX spec states the results of
sigismember() are otherwise undefined.

On Tue, Nov 17, 2020 at 7:43 PM Xavier Stonestreet
<xstonestreet@gmail.com> wrote:
>
> Hold on, I've now encountered the same issue for another service, but
> with signals :)
>
> In servicedir's finish:
> s6-permafailon 120 2 1-255,SIGBUS,SIGSEGV exit 0
>
> svc -t servicedir
> svc -t servicedir
>
> 2020-11-17 19:20:24.465424531  s6-permafailon: info: PERMANENT FAILURE
> triggered after 2 events involving signal 15 in the last 120 seconds
>
> s6-svdt servicedir | s6-tai64nlocal
> 2020-11-17 19:19:30.449842687 signal SIGTERM
> 2020-11-17 19:20:24.419594225 signal SIGTERM
>
> Back to s6-permafailon.c: the sigset_t sigs is not initialized
> either... Looks like it needs a call to sigemptyset().
>
> Hope this helps :)

  reply	other threads:[~2020-11-17 20:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 18:01 Xavier Stonestreet
2020-11-16 22:05 ` Laurent Bercot
2020-11-17 15:32   ` Xavier Stonestreet
2020-11-17 18:43     ` Xavier Stonestreet
2020-11-17 20:06       ` Xavier Stonestreet [this message]
2020-11-17 21:42       ` Laurent Bercot
2020-11-18 17:22         ` Xavier Stonestreet
2020-11-18 18:35           ` Laurent Bercot

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=CAK-rGMJbxUJAcjmgh3vd2kNrTG0T-QciAerTtrqxLh+prY5vkA@mail.gmail.com \
    --to=xstonestreet@gmail.com \
    --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).