From 62133a68b7a1aecf65765f7137ef8d6e0eed913e Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 8 May 2020 01:50:49 +0200 Subject: Cleanup: complete redesign of the initd supervisor - Cleanly seperate service description parsed from file from the actual run-time data. - Remove the use of the signalfd and make asyncronous calls into the supervisor from signal context work. Signed-off-by: David Oberhollenzer --- initd/init.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'initd/init.h') diff --git a/initd/init.h b/initd/init.h index 67d5fc4..9e18b96 100644 --- a/initd/init.h +++ b/initd/init.h @@ -15,7 +15,6 @@ #include #include -#include #include #include #include @@ -33,6 +32,24 @@ enum { STATUS_STARTED, }; +/* service run time data */ + +enum { + STATE_OFF, + STATE_RUNNING, + STATE_QUEUED, + STATE_COMPLETED, + STATE_FAILED, +}; + +typedef struct { + service_t *svc; /* the underlying service description */ + int state; /* what STATE_* the service is currently in */ + int rspwn_count; /* services respawn counter */ + int status; /* if exited, process exit status */ + pid_t pid; /* if still running, the pid */ +} svc_run_data_t; + /********** main.c **********/ void target_completed(int target); -- cgit v1.2.3