shared/install: provide more info if install_info_traverse_fails

Test case:
[Install]
WantedBy= default.target
Also=foobar-unknown.service

Before:
$ systemctl --root=/ enable testing2@instance.service
Failed to enable: No such file or directory.

After
$ ./systemctl --root=/ enable testing2@instance.service
Failed to enable unit, file foobar-unknown.service: No such file or directory.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2016-10-18 21:30:51 -04:00
parent 19539807b5
commit db093eed04
+3 -1
View File
@@ -1713,8 +1713,10 @@ static int install_context_apply(
return q;
r = install_info_traverse(scope, c, paths, i, flags, NULL);
if (r < 0)
if (r < 0) {
unit_file_changes_add(changes, n_changes, r, i->name, NULL);
return r;
}
/* We can attempt to process a masked unit when a different unit
* that we were processing specifies it in Also=. */