diff options
author | David Oberhollenzer <goliath@infraroot.at> | 2020-05-08 01:50:49 +0200 |
---|---|---|
committer | David Oberhollenzer <goliath@infraroot.at> | 2020-05-08 02:08:00 +0200 |
commit | 62133a68b7a1aecf65765f7137ef8d6e0eed913e (patch) | |
tree | f271dc8b24c4db4f7b054b633c4fa6f6e2157d5c /initd/init.h | |
parent | 13aa3840cc94ce37ef1e63c093c0f71ac84e90fd (diff) |
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 <goliath@infraroot.at>
Diffstat (limited to 'initd/init.h')
-rw-r--r-- | initd/init.h | 19 |
1 files changed, 18 insertions, 1 deletions
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 <poll.h> #include <linux/reboot.h> -#include <sys/signalfd.h> #include <sys/reboot.h> #include <stdbool.h> #include <signal.h> @@ -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); |