summaryrefslogtreecommitdiffstats
path: root/src/core/load-dropin.h
diff options
context:
space:
mode:
authorNick Rosbrook <enr0n@ubuntu.com>2024-08-08 00:18:06 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-08-09 12:25:42 +0200
commit82c482d573c9d2f3ab36f7be8d32772f90f2c335 (patch)
tree54e553bfbe06d0c2abefa9aa9c2e3620c5d8e942 /src/core/load-dropin.h
parenttest: note in README how to get full list of Ubuntu CI jobs (diff)
downloadsystemd-82c482d573c9d2f3ab36f7be8d32772f90f2c335.tar.xz
systemd-82c482d573c9d2f3ab36f7be8d32772f90f2c335.zip
core/unit: do not use unit path cache in unit_need_daemon_reload()
When unit_need_daemon_reload() calls unit_find_dropin_paths() to check for new drop-in configs, the manager's unit path cache is used to limit which directories are considered. If a new drop-in directory is created, it may not be in the unit path cache, and hence unit_need_daemon_reload() may return false, despite a new drop-in being present. However, if a unit path cache is not given to unit_file_find_dropin_paths() at all, then it behaves as if the target path was found in the unit path cache. So, to fix this, adapt unit_find_dropin_paths() to take a boolean argument indicating whether or not to pass along the unit path cache. Set this to false in unit_need_daemon_reload(). Fixes #31752
Diffstat (limited to 'src/core/load-dropin.h')
-rw-r--r--src/core/load-dropin.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/load-dropin.h b/src/core/load-dropin.h
index f0b87d3e9f..141bc7dd0f 100644
--- a/src/core/load-dropin.h
+++ b/src/core/load-dropin.h
@@ -6,12 +6,12 @@
/* Read service data supplementary drop-in directories */
-static inline int unit_find_dropin_paths(Unit *u, char ***paths) {
+static inline int unit_find_dropin_paths(Unit *u, bool use_unit_path_cache, char ***paths) {
assert(u);
return unit_file_find_dropin_paths(NULL,
u->manager->lookup_paths.search_path,
- u->manager->unit_path_cache,
+ use_unit_path_cache ? u->manager->unit_path_cache : NULL,
".d", ".conf",
u->id, u->aliases,
paths);