From 2fac65becb4eb2ae96dde034993d77f9e8bf735c Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Fri, 29 Dec 2017 20:48:47 +0100 Subject: [PATCH] Fix long-standing bug, runparts() should run before runlevel change The difference between `runparts DIR` and `/etc/rc.local` is that one should run just before the first runlevel change (to the configured runlevel) at the end of bootstrap, whereas the other should run just before launcing the TTYs, i.e. after all tasks in the configured runlevel have been started. Signed-off-by: Joachim Nilsson --- src/finit.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/finit.c b/src/finit.c index 4a5d986a..ed22f20d 100644 --- a/src/finit.c +++ b/src/finit.c @@ -270,6 +270,16 @@ static void finalize(void) _d("Calling all network up hooks ..."); plugin_run_hooks(HOOK_NETWORK_UP); + /* + * Run startup scripts in the runparts directory, if any. + */ + if (runparts && fisdir(runparts)) { + _d("Running startup scripts in %s ...", runparts); + run_parts(runparts, NULL); + if (conf_any_change()) + service_reload_dynamic(); + } + /* * Start all tasks/services in the configured runlevel */ @@ -285,16 +295,6 @@ static void finalize(void) plugin_run_hooks(HOOK_SVC_UP); service_step_all(SVC_TYPE_ANY); - /* - * Run startup scripts in the runparts directory, if any. - */ - if (runparts && fisdir(runparts)) { - _d("Running startup scripts in %s ...", runparts); - run_parts(runparts, NULL); - if (conf_any_change()) - service_reload_dynamic(); - } - /* Convenient SysV compat for when you just don't care ... */ if (!access(FINIT_RC_LOCAL, X_OK)) { run_interactive(FINIT_RC_LOCAL, "Calling %s", FINIT_RC_LOCAL);