Only reload .conf and services if any .conf file has changed

This patch is an optimization.  Now that we monitor for any .conf file
changes (as soon as the event loop starts) we can skip automatic reload
of all .conf files and services if no .conf file has changed.  Unless
the user issues an `initctl reload`, `init q`, or sends us SIGHUP.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-12-29 19:22:01 +01:00
1 parent 33ce746e58
commit f2d142ef57
4 files changed
+14 -3

No files matched your search

+4 -2
View File
@@ -291,13 +291,15 @@ static void finalize(void)
if (runparts && fisdir(runparts)) {
_d("Running startup scripts in %s ...", runparts);
run_parts(runparts, NULL);
service_reload_dynamic();
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);
service_reload_dynamic();
if (conf_any_change())
service_reload_dynamic();
}
/* Hooks that should run at the very end */