]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/install: provide more info if install_info_traverse_fails
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 17 Oct 2016 01:27:57 +0000 (21:27 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 19 Oct 2016 01:30:51 +0000 (21:30 -0400)
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.

src/shared/install.c

index 9e26284ade70a87b07e044ebc0b719493b8e0947..32f7edc8cc87ba76a66dd7324566cde2340c6c92 100644 (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=. */