From f3fcca615054f7c779925ed364946cee926dfded Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 23 Nov 2022 17:35:01 +0100 Subject: [PATCH] Revert "Refactor, enter main event loop earlier" This reverts commit 03c08d3970053254cb1c2dd68e72de640cc44a2d due to it breaking handling of bootstrap tasks, causing endless boot loop. Signed-off-by: Joachim Wiberg --- src/finit.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/finit.c b/src/finit.c index 8fe8e8f1..ffbf72a8 100644 --- a/src/finit.c +++ b/src/finit.c @@ -581,17 +581,6 @@ static void bootstrap_worker(void *work) static int cnt = 120 * 10; /* We run with 100ms period */ int level = cfglevel; - /* - * Set up inotify watcher for /etc/finit.conf, /etc/finit.d, and - * their deps, to figure out how to bootstrap the system. - */ - conf_monitor(); - - /* - * Background service tasks - */ - service_init(); - dbg("Step all services ..."); service_step_all(SVC_TYPE_ANY); @@ -835,6 +824,12 @@ int main(int argc, char *argv[]) dbg("Base FS up, calling hooks ..."); plugin_run_hooks(HOOK_BASEFS_UP); + /* + * Set up inotify watcher for /etc/finit.conf, /etc/finit.d, and + * their deps, to figure out how to bootstrap the system. + */ + conf_monitor(); + dbg("Starting initctl API responder ..."); api_init(&loop); @@ -844,6 +839,11 @@ int main(int argc, char *argv[]) dbg("Starting bootstrap finalize timer ..."); schedule_work(&bootstrap_work); + /* + * Background service tasks + */ + service_init(); + /* * Enter main loop to monitor /dev/initctl and services */