diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-07-10 18:01:13 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-07-30 14:01:46 +0200 |
commit | 91e0ee5f16321656ed6f827742ecbeb2b36027f2 (patch) | |
tree | 41f3b5b389f8e6353b5e8bfb34272add25b10385 /src/core/load-fragment.c | |
parent | e67cd21d7d174cdafd12beca4cfb6e19e61f6fb5 (diff) | |
download | systemd-91e0ee5f16321656ed6f827742ecbeb2b36027f2.tar.gz |
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.
Diffstat (limited to 'src/core/load-fragment.c')
-rw-r--r-- | src/core/load-fragment.c | 9 |
1 files changed, 9 insertions, 0 deletions
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, |