summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2019-09-24 18:54:15 +0200
committerFranck Bui <fbui@suse.com>2019-09-24 19:05:06 +0200
commit22683674716fd0e5b016ce5a7d8fd90df5f9f9e7 (patch)
treeb3117e03d5871babb79c1abd0fd5c1ffeed71ccc
parent56a4ce2417ff74f82a48e3a5c6e36edad8d4bc6c (diff)
downloadsystemd-22683674716fd0e5b016ce5a7d8fd90df5f9f9e7.tar.gz
shared/install: failing with -ELOOP can be due to the use of an alias in install_error()
-ELOOP can happen also when enabling an alias name (which is admittedly useless since the unit it belongs to was already enabled) so let's mention this possibility when reporting the corresponding error.
-rw-r--r--src/core/dbus-manager.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index 035011e34f..98d2e828a3 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -1903,11 +1903,13 @@ static int install_error(
case -ELOOP:
r = sd_bus_error_setf(error, BUS_ERROR_UNIT_LINKED,
- "Refusing to operate on linked unit file %s", changes[i].path);
+ "Refusing to operate on alias name or linked unit file: %s",
+ changes[i].path);
goto found;
case -ENOENT:
- r = sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_UNIT, "Unit file %s does not exist.", changes[i].path);
+ r = sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_UNIT,
+ "Unit file %s does not exist.", changes[i].path);
goto found;
default: