diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-20 20:34:12 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-20 20:34:12 +0000 |
commit | bb9a68add4feef7c53ba3994256745ea99cffef8 (patch) | |
tree | deac3ebb8326e97d8432a8a7cabab34e1e16bda8 /src/supervision/s6-supervise.c | |
parent | b4518d79cc80e7ea0f4e53345ca29afa21e4f0f3 (diff) | |
download | s6-bb9a68add4feef7c53ba3994256745ea99cffef8.tar.xz |
Implement permanent failure for services via ./finish exiting 125
Diffstat (limited to 'src/supervision/s6-supervise.c')
-rw-r--r-- | src/supervision/s6-supervise.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/supervision/s6-supervise.c b/src/supervision/s6-supervise.c index 8bb55c8..2e8ce6a 100644 --- a/src/supervision/s6-supervise.c +++ b/src/supervision/s6-supervise.c @@ -436,7 +436,13 @@ static void finishtimeout (void) static void finish_z (void) { - set_down_and_ready("D", 1) ; + int wstat = (int)status.pid ; + if (WIFEXITED(wstat) && WEXITSTATUS(wstat) == 125) + { + status.flagwant = 0 ; + set_down_and_ready("OD", 2) ; + } + else set_down_and_ready("D", 1) ; } static void finish_u (void) |