From 96342de68d0d6de71a062d984dafd2a0905ed9fe Mon Sep 17 00:00:00 2001 From: Lukas Nykryn Date: Mon, 13 Aug 2012 13:58:01 +0200 Subject: service: add options RestartPreventExitStatus and SuccessExitStatus In some cases, like wrong configuration, restarting after error does not help, so administrator can specify statuses by RestartPreventExitStatus which will not cause restart of a service. Sometimes you have non-standart exit status, so this can be specified by SuccessfulExitStatus. --- src/shared/exit-status.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/shared/exit-status.h') diff --git a/src/shared/exit-status.h b/src/shared/exit-status.h index 3f42c15e3b..d3b548fc96 100644 --- a/src/shared/exit-status.h +++ b/src/shared/exit-status.h @@ -22,7 +22,7 @@ ***/ #include - +#include "set.h" typedef enum ExitStatus { /* EXIT_SUCCESS defined by libc */ /* EXIT_FAILURE defined by libc */ @@ -77,7 +77,12 @@ typedef enum ExitStatusLevel { EXIT_STATUS_FULL = EXIT_STATUS_LSB } ExitStatusLevel; +typedef struct ExitStatusSet { + Set *code; + Set *signal; +} ExitStatusSet; + const char* exit_status_to_string(ExitStatus status, ExitStatusLevel level); -bool is_clean_exit(int code, int status); -bool is_clean_exit_lsb(int code, int status); +bool is_clean_exit(int code, int status, ExitStatusSet *success_status); +bool is_clean_exit_lsb(int code, int status, ExitStatusSet *success_status); -- cgit v1.2.3-54-g00ecf