From 91e0ee5f16321656ed6f827742ecbeb2b36027f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 10 Jul 2019 18:01:13 +0200 Subject: pid1: drop unit caches only based on mtime v2: - do not watch mtime of transient and generated dirs We'd reload the map after every transient unit we created, which we don't need to do, since we create those units ourselves and know their fragment path. --- src/core/load-fragment.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/core/load-fragment.c') diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 7521d599e9..f34e424fbc 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -4611,6 +4611,15 @@ int unit_load_fragment(Unit *u) { return 0; } + /* Possibly rebuild the fragment map to catch new units */ + r = unit_file_build_name_map(&u->manager->lookup_paths, + &u->manager->unit_cache_mtime, + &u->manager->unit_id_map, + &u->manager->unit_name_map, + &u->manager->unit_path_cache); + if (r < 0) + log_error_errno(r, "Failed to rebuild name map: %m"); + r = unit_file_find_fragment(u->manager->unit_id_map, u->manager->unit_name_map, u->id, -- cgit v1.2.1