aboutsummaryrefslogtreecommitdiff
path: root/initd/init.h
diff options
context:
space:
mode:
Diffstat (limited to 'initd/init.h')
-rw-r--r--initd/init.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/initd/init.h b/initd/init.h
index 2c2adb1..813dedb 100644
--- a/initd/init.h
+++ b/initd/init.h
@@ -10,6 +10,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <endian.h>
+#include <assert.h>
#include <stdio.h>
#include <errno.h>
#include <poll.h>
@@ -54,4 +55,43 @@ typedef struct {
*/
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);
+
+/* get the current run time target from the configuration manager */
+int config_get_current_target(void);
+
+/*
+ Find out if the current target is completed, i.e. there are no more services
+ left in the queue and no active single shot services.
+ */
+bool config_is_current_target_complete(void);
+
+/* Ask whether we should respawn services in the current target */
+bool config_should_respawn(void);
+
+/* notify the configuration manager that a single shot service started */
+void config_singleshot_started(void);
+
+/* notify the configuration manager that a single shot service terminated */
+void config_singleshot_terminated(void);
+
#endif /* INIT_H */