From c16735414ba63cb593881cd32e46dc086f003181 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 28 Mar 2019 13:44:28 +0100 Subject: initd: Hand out unique IDs to services Signed-off-by: David Oberhollenzer --- initd/supervisor.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'initd') diff --git a/initd/supervisor.c b/initd/supervisor.c index 4f7ddc9..871618a 100644 --- a/initd/supervisor.c +++ b/initd/supervisor.c @@ -3,6 +3,7 @@ static service_list_t cfg; +static int service_id = 1; static int target = -1; static service_t *running = NULL; static service_t *terminated = NULL; @@ -14,6 +15,9 @@ static bool waiting = false; static int start_service(service_t *svc) { + if (svc->id < 1) + svc->id = service_id++; + svc->pid = runsvc(svc); if (svc->pid == -1) { print_status(svc->desc, STATUS_FAIL, false); -- cgit v1.2.3