summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-03-02 16:53:54 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-03-29 16:17:56 +0200
commit212a24f0bbe4c54183d3b0ad9579a995007e29a8 (patch)
tree9d593625c9b1f12c5ca0456b6408367d5b55e1df /src
parenttest-systemctl-enable: extend the test for repeated WantedBy/RequiredBy (diff)
downloadsystemd-212a24f0bbe4c54183d3b0ad9579a995007e29a8.tar.xz
systemd-212a24f0bbe4c54183d3b0ad9579a995007e29a8.zip
shared/install: when we fail to chase a symlink, show some logs
When chase_symlinks() fails, we'd get the generic error: Failed to disable: Permission denied. Let's at least add the failure to changes list, so the user gets a slightly better message. Ideally, we'd say where exactly the permission failure occured, but chase_symlinks() is a library level function and I don't think we should add logging there. The output looks like this now: Failed to resolve symlink "/tmp/systemctl-test.1r7Roj/etc/systemd/system/link5alias2.service": Permission denied Failed to resolve symlink "/tmp/systemctl-test.1r7Roj/etc/systemd/system/link5alias.service": Permission denied Failed to disable unit, file /tmp/systemctl-test.1r7Roj/etc/systemd/system/link5alias2.service: Permission denied. Failed to disable unit, file /tmp/systemctl-test.1r7Roj/etc/systemd/system/link5alias.service: Permission denied.
Diffstat (limited to 'src')
-rw-r--r--src/shared/install.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shared/install.c b/src/shared/install.c
index a4c4be16b3..d20372cfd9 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -615,6 +615,9 @@ static int remove_marked_symlinks_fd(
if (q == -ENOENT)
continue;
if (q < 0) {
+ log_debug_errno(q, "Failed to resolve symlink \"%s\": %m", p);
+ unit_file_changes_add(changes, n_changes, q, p, NULL);
+
if (r == 0)
r = q;
continue;