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 <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2017-12-20 00:10:29 +01:00
parent db50c09ec5
commit 7784480abe
+9 -9
View File
@@ -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);