|
|
8d419f |
From 144887f20bb2dc9f46060091db03d4f517f1d518 Mon Sep 17 00:00:00 2001
|
|
|
8d419f |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
|
8d419f |
Date: Wed, 2 Mar 2022 16:53:54 +0100
|
|
|
8d419f |
Subject: [PATCH] shared/install: when we fail to chase a symlink, show some
|
|
|
8d419f |
logs
|
|
|
8d419f |
|
|
|
8d419f |
When chase_symlinks() fails, we'd get the generic error:
|
|
|
8d419f |
|
|
|
8d419f |
Failed to disable: Permission denied.
|
|
|
8d419f |
|
|
|
8d419f |
Let's at least add the failure to changes list, so the user gets
|
|
|
8d419f |
a slightly better message. Ideally, we'd say where exactly the permission
|
|
|
8d419f |
failure occured, but chase_symlinks() is a library level function and I don't
|
|
|
8d419f |
think we should add logging there. The output looks like this now:
|
|
|
8d419f |
|
|
|
8d419f |
Failed to resolve symlink "/tmp/systemctl-test.1r7Roj/etc/systemd/system/link5alias2.service": Permission denied
|
|
|
8d419f |
Failed to resolve symlink "/tmp/systemctl-test.1r7Roj/etc/systemd/system/link5alias.service": Permission denied
|
|
|
8d419f |
Failed to disable unit, file /tmp/systemctl-test.1r7Roj/etc/systemd/system/link5alias2.service: Permission denied.
|
|
|
8d419f |
Failed to disable unit, file /tmp/systemctl-test.1r7Roj/etc/systemd/system/link5alias.service: Permission denied.
|
|
|
8d419f |
|
|
|
8d419f |
(cherry picked from commit 212a24f0bbe4c54183d3b0ad9579a995007e29a8)
|
|
|
8d419f |
|
|
|
8d419f |
Related: #2082131
|
|
|
8d419f |
---
|
|
|
8d419f |
src/shared/install.c | 3 +++
|
|
|
8d419f |
1 file changed, 3 insertions(+)
|
|
|
8d419f |
|
|
|
8d419f |
diff --git a/src/shared/install.c b/src/shared/install.c
|
|
|
8d419f |
index bf11e5bdce..ce045d02be 100644
|
|
|
8d419f |
--- a/src/shared/install.c
|
|
|
8d419f |
+++ b/src/shared/install.c
|
|
|
8d419f |
@@ -616,6 +616,9 @@ static int remove_marked_symlinks_fd(
|
|
|
8d419f |
if (q == -ENOENT)
|
|
|
8d419f |
continue;
|
|
|
8d419f |
if (q < 0) {
|
|
|
8d419f |
+ log_debug_errno(q, "Failed to resolve symlink \"%s\": %m", p);
|
|
|
8d419f |
+ unit_file_changes_add(changes, n_changes, q, p, NULL);
|
|
|
8d419f |
+
|
|
|
8d419f |
if (r == 0)
|
|
|
8d419f |
r = q;
|
|
|
8d419f |
continue;
|