aboutsummaryrefslogtreecommitdiff
path: root/initd/supervisor.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <goliath@infraroot.at>2019-03-29 13:46:56 +0100
committerDavid Oberhollenzer <goliath@infraroot.at>2019-03-29 21:00:53 +0100
commitc8c0f10ce1923bb541bf80027739e205bcbde436 (patch)
tree5b3173e57874e5b03cf8cceb6fb34e7b98385be4 /initd/supervisor.c
parentbe066419049587e1349ada03306d004c30c18da6 (diff)
Keep original respawn limit
We also want this meachanism to still work for manually started service (especially after reloading services). Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
Diffstat (limited to 'initd/supervisor.c')
-rw-r--r--initd/supervisor.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/initd/supervisor.c b/initd/supervisor.c
index 3f157bf..a11c6b8 100644
--- a/initd/supervisor.c
+++ b/initd/supervisor.c
@@ -82,9 +82,9 @@ static void handle_terminated_service(service_t *svc)
break;
if (svc->rspwn_limit > 0) {
- svc->rspwn_limit -= 1;
+ svc->rspwn_count += 1;
- if (svc->rspwn_limit == 0) {
+ if (svc->rspwn_count >= svc->rspwn_limit) {
print_status(svc->desc, STATUS_FAIL, false);
goto out_failure;
}
@@ -319,9 +319,7 @@ void supervisor_start(int id)
}
return;
found:
- if (svc->type == SVC_RESPAWN)
- svc->rspwn_limit = 0;
-
+ svc->rspwn_count = 0;
svc->flags &= ~SVC_FLAG_ADMIN_STOPPED;
svc->next = queue;
queue = svc;