/* SPDX-License-Identifier: ISC */ #ifndef INIT_H #define INIT_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "service.h" #include "config.h" #include "util.h" #define ENVFILE ETCPATH "/initd.env" #define PROCFDDIR "/proc/self/fd" /********** runsvc.c **********/ /* Invoke the runsvc command to execute the comands of a service. Returns the pid of the child process containing the runsvc instance. */ pid_t runsvc(service_t *svc); /********** config.c **********/ /* load persistent configuration from disk */ int config_load(void); svc_run_data_t *config_rt_data_by_pid(pid_t pid); /* Get the next service that is waiting to be launched. Returns NULL if the queue is empty. */ svc_run_data_t *config_dequeue(void); /* Transition to a different target, if possible in the current state. The transition may be ignored, e.g. if we are currently in the reboot or shutdown target. */ void config_set_target(int tgt); /* Ask whether we should respawn services in the current target */ bool config_should_respawn(void); /* refuse to dequeue further services until this one terminates */ void config_set_waiting(svc_run_data_t *rt); /* are we currently waiting for a service to terminate? */ bool config_is_waiting(void); /********** print_status.c **********/ void print_status(const svc_run_data_t *rt); #endif /* INIT_H */