summaryrefslogtreecommitdiff
path: root/src/systemctl/systemctl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-04-11 17:57:05 +0200
committerLennart Poettering <lennart@poettering.net>2016-04-12 13:43:33 +0200
commit8e20adcaa0cf06a85d36e2fda35fa1d70d5d63c8 (patch)
tree6abaead08125a91d851548b06f21bb2b95b18988 /src/systemctl/systemctl.c
parentd94c2b06f9800d635f3cb05b4a6c67145aa1ba09 (diff)
core: make sure we generate a nicer error when a linked unit is attempted to be enabled
We don't allow using config symlinks to enable units, but the error message we printed was awful. Fix that, and generate a more readable error. Fixes #3010.
Diffstat (limited to 'src/systemctl/systemctl.c')
-rw-r--r--src/systemctl/systemctl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index b94af9cf08..9efdc63dde 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -5446,6 +5446,8 @@ static int enable_unit(int argc, char *argv[], void *userdata) {
return log_error_errno(r, "Unit file is masked.");
if (r == -EADDRNOTAVAIL)
return log_error_errno(r, "Unit file is transient or generated.");
+ if (r == -ELOOP)
+ return log_error_errno(r, "Refusing to operate on linked unit file.");
if (r < 0)
return log_error_errno(r, "Operation failed: %m");