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
<xstonestr...@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 via email to