mirror of
https://github.com/pygos/init.git
synced 2024-05-19 20:26:14 +02:00
initd: store completed services in list instead of deleting them
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
This commit is contained in:
parent
5b106abaed
commit
c544fcc7a3
|
@ -7,6 +7,7 @@ static int target = -1;
|
||||||
static service_t *running = NULL;
|
static service_t *running = NULL;
|
||||||
static service_t *terminated = NULL;
|
static service_t *terminated = NULL;
|
||||||
static service_t *queue = NULL;
|
static service_t *queue = NULL;
|
||||||
|
static service_t *completed = NULL;
|
||||||
static int singleshot = 0;
|
static int singleshot = 0;
|
||||||
static bool waiting = false;
|
static bool waiting = false;
|
||||||
|
|
||||||
|
@ -15,7 +16,8 @@ static int start_service(service_t *svc)
|
||||||
svc->pid = runsvc(svc);
|
svc->pid = runsvc(svc);
|
||||||
if (svc->pid == -1) {
|
if (svc->pid == -1) {
|
||||||
print_status(svc->desc, STATUS_FAIL, false);
|
print_status(svc->desc, STATUS_FAIL, false);
|
||||||
delsvc(svc);
|
svc->next = completed;
|
||||||
|
completed = svc;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +61,8 @@ static void handle_terminated_service(service_t *svc)
|
||||||
target_completed(target);
|
target_completed(target);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
delsvc(svc);
|
svc->next = completed;
|
||||||
|
completed = svc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void supervisor_handle_exited(pid_t pid, int status)
|
void supervisor_handle_exited(pid_t pid, int status)
|
||||||
|
|
Loading…
Reference in a new issue