core: introduce new RestartForceExitStatus= service setting

This does the inverse of RestartPreventExitStatus=: it forces a restart
of a service when a certain exit status is returned by a service
process.
This commit is contained in:
Lennart Poettering
2014-07-03 12:51:07 +02:00
parent ffd488e272
commit 37520c1bec
6 changed files with 46 additions and 27 deletions
+8
View File
@@ -208,3 +208,11 @@ bool is_clean_exit_lsb(int code, int status, ExitStatusSet *success_status) {
code == CLD_EXITED &&
(status == EXIT_NOTINSTALLED || status == EXIT_NOTCONFIGURED);
}
void exit_status_set_free(ExitStatusSet *x) {
assert(x);
set_free(x->code);
set_free(x->signal);
x->code = x->signal = NULL;
}