From ec74e5bbee30381b1624ac2247e74fa29676c6e6 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 24 Aug 2018 16:51:15 +0200 Subject: initd: restructure and merge service supervision code Signed-off-by: David Oberhollenzer --- initd/init.h | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'initd/init.h') diff --git a/initd/init.h b/initd/init.h index 2c39489..7d525a2 100644 --- a/initd/init.h +++ b/initd/init.h @@ -18,6 +18,16 @@ #ifndef INIT_H #define INIT_H +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include #include @@ -36,6 +46,10 @@ enum { STATUS_STARTED, }; +/********** main.c **********/ + +void target_completed(int target); + /********** runsvc.c **********/ /* @@ -45,12 +59,6 @@ enum { */ pid_t runsvc(service_t *svc); -/* - Start a service using runsvc, but wait until the child process - terminats and return its exit status. -*/ -int runsvc_wait(service_t *svc); - /********** status.c **********/ /* @@ -64,25 +72,15 @@ int runsvc_wait(service_t *svc); */ void print_status(const char *msg, int type, bool update); -/********** svclist.c **********/ +/********** supervisor.c **********/ -/* - Returns true if the list of running services contains - single shot processes. -*/ -bool svclist_have_singleshot(void); +void supervisor_handle_exited(pid_t pid, int status); -/* Add a service to the list of running services */ -void svclist_add(service_t *svc); +void supervisor_set_target(int next); -/* - Remove a service, identifierd by PID, from the list of - running services. +void supervisor_init(void); - Returns the service identified by the PID or NULL if there - is no such service. -*/ -service_t *svclist_remove(pid_t pid); +bool supervisor_process_queues(void); /********** signal_.c **********/ -- cgit v1.2.3