From 7784480abe2593a8fd006220bcce5f7afcbbcba0 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Wed, 20 Dec 2017 00:10:29 +0100 Subject: [PATCH] Postpone networking stuff, + hooks, a bit to the finalize() step This patch moves the networking bit to the latter part of bootstrap, called finalize(), in favor of starting the event loop earlier. Signed-off-by: Joachim Nilsson --- src/finit.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/finit.c b/src/finit.c index 811a6e26..4eeb1172 100644 --- a/src/finit.c +++ b/src/finit.c @@ -253,6 +253,15 @@ static void emergency_shell(void) */ static void finalize(void) { + /* + * Network stuff + */ + networking(); + umask(022); + + /* Hooks that rely on loopback, or basic networking being up. */ + plugin_run_hooks(HOOK_NETWORK_UP); + /* * Start all tasks/services in the configured runlevel */ @@ -489,15 +498,6 @@ int main(int argc, char* argv[]) sm_init(&sm); sm_step(&sm); - /* - * Network stuff - */ - networking(); - umask(022); - - /* Hooks that rely on loopback, or basic networking being up. */ - plugin_run_hooks(HOOK_NETWORK_UP); - /* Start new initctl API responder */ api_init(&loop);