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
This commit is contained in:
committed by
Yu Watanabe
parent
79488ac003
commit
82c482d573
+1
-1
@@ -3809,7 +3809,7 @@ bool unit_need_daemon_reload(Unit *u) {
|
||||
if (u->load_state == UNIT_LOADED) {
|
||||
_cleanup_strv_free_ char **dropins = NULL;
|
||||
|
||||
(void) unit_find_dropin_paths(u, &dropins);
|
||||
(void) unit_find_dropin_paths(u, /* use_unit_path_cache = */ false, &dropins);
|
||||
|
||||
if (!strv_equal(u->dropin_paths, dropins))
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user