systemd: do not pass .wants fragment path to manager_load_unit
When loading units, sometimes we'd first encounter a unit from .wants or .requires directory. A typical case would be when multi-user.target.wants/ contains a symlink to some unit. We would prepare to load this unit using /etc/systemd/system/multi-user.target.wants/foo.service as the fragment path. This is always wrong. Instead, let's use NULL as the path and let manager_load_unit() figure out the path on its own. Fixes #9921. path=0x5625ed9b01a0 "/usr/lib/systemd/system/local-fs.target.wants/systemd-remount-fs.service", e=0x0, _ret=0x7ffe64645000) at ../src/core/manager.c:1887 name=0x5625ed9b01ce "systemd-remount-fs.service", path=0x5625ed9b01a0 "/usr/lib/systemd/system/local-fs.target.wants/systemd-remount-fs.service", e=0x0, _ret=0x7ffe64645000) at ../src/core/manager.c:1961 name=0x5625ed9b01ce "systemd-remount-fs.service", path=0x5625ed9b01a0 "/usr/lib/systemd/system/local-fs.target.wants/systemd-remount-fs.service", add_reference=true, mask=UNIT_DEPENDENCY_FILE) at ../src/core/unit.c:2946 dir_suffix=0x5625ebb179ed ".wants") at ../src/core/load-dropin.c:95 path=0x0, e=0x0, _ret=0x7ffe646452c0) at ../src/core/manager.c:1965 name=0x5625ebb186f8 "local-fs.target", path=0x0, add_reference=true, mask=UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT) at ../src/core/unit.c:2946 where=0x5625ed9b3cc0 "/tmp", options=0x5625ed947110 "rw,nosuid,nodev,seclabel", fstype=0x5625ed95be90 "tmpfs", flags=0x7ffe64645395) at ../src/core/mount.c:1439 where=0x5625ed9b3cc0 "/tmp", options=0x5625ed947110 "rw,nosuid,nodev,seclabel", fstype=0x5625ed95be90 "tmpfs", set_flags=false) at ../src/core/mount.c:1567 at ../src/core/mount.c:1635 ret_retval=0x7ffe64645660, ret_shutdown_verb=0x7ffe646456c0, ret_fds=0x7ffe646456d8, ret_switch_root_dir=0x7ffe646456b0, ret_switch_root_init=0x7ffe646456b8, ret_error_message=0x7ffe646456c8) at ../src/core/main.c:1669
This commit is contained in:
parent
9035119518
commit
0c062fd3eb
|
@ -92,7 +92,7 @@ static int process_deps(Unit *u, UnitDependency dependency, const char *dir_suff
|
|||
log_unit_warning(u, "%s dependency dropin %s target %s has different name",
|
||||
unit_dependency_to_string(dependency), *p, target);
|
||||
|
||||
r = unit_add_dependency_by_name(u, dependency, entry, *p, true, UNIT_DEPENDENCY_FILE);
|
||||
r = unit_add_dependency_by_name(u, dependency, entry, NULL, true, UNIT_DEPENDENCY_FILE);
|
||||
if (r < 0)
|
||||
log_unit_warning_errno(u, r, "Cannot add %s dependency on %s, ignoring: %m",
|
||||
unit_dependency_to_string(dependency), entry);
|
||||
|
|
Loading…
Reference in a new issue