From 75c4223a7f5a8a073ba0d898ef9d841fdaef2f63 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 21 Mar 2018 18:00:10 +0000 Subject: Add s6-svdt-clear, s6-permafailon --- .gitignore | 3 + NEWS | 3 +- doc/index.html | 2 + doc/s6-permafailon.html | 98 ++++++++++++++++++++++++++ doc/s6-svdt-clear.html | 58 ++++++++++++++++ doc/s6-svdt.html | 6 +- doc/s6-svstat.html | 5 +- doc/upgrade.html | 6 +- package/deps.mak | 6 ++ package/modes | 2 + package/targets.mak | 2 + src/supervision/deps-exe/s6-permafailon | 2 + src/supervision/deps-exe/s6-svdt-clear | 2 + src/supervision/s6-permafailon.c | 118 ++++++++++++++++++++++++++++++++ src/supervision/s6-svdt-clear.c | 15 ++++ 15 files changed, 322 insertions(+), 6 deletions(-) create mode 100644 doc/s6-permafailon.html create mode 100644 doc/s6-svdt-clear.html create mode 100644 src/supervision/deps-exe/s6-permafailon create mode 100644 src/supervision/deps-exe/s6-svdt-clear create mode 100644 src/supervision/s6-permafailon.c create mode 100644 src/supervision/s6-svdt-clear.c diff --git a/.gitignore b/.gitignore index 18a5950..98f7368 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,9 @@ /s6-svlisten1 /s6-svlisten /s6-notifyoncheck +/s6-svdt +/s6-svdt-clear +/s6-permafailon /s6-envdir /s6-envuidgid /s6-fghack diff --git a/NEWS b/NEWS index 0e1aa75..8c3c5af 100644 --- a/NEWS +++ b/NEWS @@ -5,7 +5,8 @@ In 2.7.1.0 - Bugfixes. - s6-svwait et al. now exit 102 instead of hanging if s6-supervise dies. - - New command: s6-svdt + - New commands: s6-svdt, s6-svdt-clear, s6-permafailon + - s6-tai64nlocal can now print GMT times with the -g option. In 2.7.0.0 diff --git a/doc/index.html b/doc/index.html index 733e3ee..bae4da6 100644 --- a/doc/index.html +++ b/doc/index.html @@ -157,6 +157,8 @@ a user interface to control those processes and monitor service states.
  • The s6-svlisten program
  • The s6-notifyoncheck program
  • The s6-svdt program
  • +
  • The s6-svdt-clear program
  • +
  • The s6-permafailon program
  • Daemontools-like utilities

    diff --git a/doc/s6-permafailon.html b/doc/s6-permafailon.html new file mode 100644 index 0000000..f749d5f --- /dev/null +++ b/doc/s6-permafailon.html @@ -0,0 +1,98 @@ + + + + + + s6: the s6-permafailon program + + + + + + +

    +s6
    +Software
    +skarnet.org +

    + +

    The s6-permafailon program

    + +

    +s6-permafailon is a program that is meant to be used +in the ./finish script of a +service directory supervised by +s6-supervise. When used, it +reads and analyses the death tally of a service (i.e. the recent +process death events that happened), and if the death tally +matches a given pattern, it causes permanent failure +of the service, i.e. it tells the supervisor not to try and +restart it. +

    + +

    Interface

    + +
    +     s6-permafailon secs deathcount events prog...
    +
    + + + +

    + events is a comma-separated list of events. An event can be +one of the following: +

    + + + +

    Usage

    + + + +

    Example

    + +

    + s6-permafailon 60 5 1,101-103,SIGSEGV,SIBBUS prog... +will exit 125 if the service has died 5 times in the last 60 seconds with +an exit code of 1, 101, 102 or 103, a SIGSEGV or a SIGBUS. Else it will +chainload into the prog... command line. +

    + + + diff --git a/doc/s6-svdt-clear.html b/doc/s6-svdt-clear.html new file mode 100644 index 0000000..e69a1ae --- /dev/null +++ b/doc/s6-svdt-clear.html @@ -0,0 +1,58 @@ + + + + + + s6: the s6-svdt-clear program + + + + + + +

    +s6
    +Software
    +skarnet.org +

    + +

    The s6-svdt-clear program

    + +

    +s6-svdt-clear clears the recorded death tally of a service. +

    + +

    Interface

    + +
    +     s6-svdt-clear servicedir
    +
    + +

    + s6-svdt-clear clears the recorded death tally of the service being +currently supervised at the servicedir +service directory. +

    + + + +

    Notes

    + + + + + diff --git a/doc/s6-svdt.html b/doc/s6-svdt.html index a908d8c..f069536 100644 --- a/doc/s6-svdt.html +++ b/doc/s6-svdt.html @@ -16,10 +16,10 @@ skarnet.org

    -

    The s6-svdt program

    +

    The s6-svdt program

    -s6-svstat prints the recorded death tally of a service, i.e. a list of the times +s6-svdt prints the recorded death tally of a service, i.e. a list of the times the process died, with the cause of death.

    @@ -30,7 +30,7 @@ the process died, with the cause of death.

    - s6-svdt prints the contents of the recorded death tally of the service being + s6-svdt prints the contents of the recorded death tally of the service being currently supervised at the servicedir service directory, then exits 0.

    diff --git a/doc/s6-svstat.html b/doc/s6-svstat.html index a77f903..d40ec3b 100644 --- a/doc/s6-svstat.html +++ b/doc/s6-svstat.html @@ -76,8 +76,11 @@ are as follows. names are the following: