core/manager: do not re-init Manager.lookup_paths when manager_reload()

Follow-up for 99aad9a2b9

The commit changed lookup_paths_init_or_warn() call to
be fatal to manager_reload(), but invoke_main_loop()
assumes that manager_reload() would only return
recoverable error, and put the manager back to
MANAGER_OK in that case, which is spurious.

Looking at it more, it appears to be utterly unnecessary
to reinitialize LookupPaths here, given that nothing during
the reload process would change the search dirs. Let's drop
the path altogether hence.
This commit is contained in:
Mike Yuan
2024-09-07 14:52:50 +02:00
parent e634df9f16
commit 30b55e98d1
-7
View File
@@ -3707,21 +3707,14 @@ int manager_reload(Manager *m) {
manager_clear_jobs_and_units(m);
lookup_paths_flush_generator(&m->lookup_paths);
lookup_paths_done(&m->lookup_paths);
exec_shared_runtime_vacuum(m);
dynamic_user_vacuum(m, false);
m->uid_refs = hashmap_free(m->uid_refs);
m->gid_refs = hashmap_free(m->gid_refs);
r = lookup_paths_init_or_warn(&m->lookup_paths, m->runtime_scope, 0, NULL);
if (r < 0)
return r;
(void) manager_run_environment_generators(m);
(void) manager_run_generators(m);
lookup_paths_log(&m->lookup_paths);
/* We flushed out generated files, for which we don't watch mtime, so we should flush the old map. */
manager_free_unit_name_maps(m);
m->unit_file_state_outdated = false;