summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-04-17 20:37:30 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-04-19 09:03:47 -0400
commitfe4aede922f145df8b82108d937b65dcd3443588 (patch)
tree3a6933e34367d77f5160edeba5c1b408e02c3117 /src/shared
parent1fa0336081a671001a59ea56376132f3ef069a7b (diff)
systemctl: warning about missing install info for template units
The advice string didn't talk about template units at all. Extend it and print when trying to enable a template unit without install info. Fixes #2345.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/install.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/shared/install.c b/src/shared/install.c
index febe33ed7b..71012eafb4 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -1466,8 +1466,10 @@ static int install_info_symlink_link(
assert(i->path);
r = in_search_path(paths, i->path);
- if (r != 0)
+ if (r < 0)
return r;
+ if (r > 0)
+ return 0;
path = strjoin(config_path, "/", i->name, NULL);
if (!path)
@@ -1506,7 +1508,8 @@ static int install_info_apply(
r = q;
q = install_info_symlink_link(i, paths, config_path, force, changes, n_changes);
- if (r == 0)
+ /* Do not count links to the unit file towards the "carries_install_info" count */
+ if (r == 0 && q < 0)
r = q;
return r;