summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2021-10-06 13:20:36 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-10-12 18:05:25 +0200
commit5bb214a786ef6156b952584ef3107aee1e7ecbcd (patch)
treeafaa85bdf0f5b7aa8239d39b1306a1a63750bd86
parentb1b3716efebb7c52254b7029a05b1ec0c8d317bd (diff)
downloadsystemd-5bb214a786ef6156b952584ef3107aee1e7ecbcd.tar.gz
coredump: Don't log an error if D-Bus isn't running
coredumpctl could be used in a chroot where D-Bus isn't running. If that's the case, we shouldn't consider it an error if we can't connect to the D-Bus daemon so let's reduce the severity of the error we log when we can't connect to D-Bus because the socket doesn't exist. (cherry picked from commit 414bd2e786f9912f51b82e5fe4a1126179a5652a) (cherry picked from commit 6745eaa6308b835e2c5e68d49e9bece29fd37fa2)
-rw-r--r--src/coredump/coredumpctl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/coredump/coredumpctl.c b/src/coredump/coredumpctl.c
index fbd4df04e6..89c4d69856 100644
--- a/src/coredump/coredumpctl.c
+++ b/src/coredump/coredumpctl.c
@@ -1151,6 +1151,10 @@ static int check_units_active(void) {
return false;
r = sd_bus_default_system(&bus);
+ if (r == -ENOENT) {
+ log_debug("D-Bus is not running, skipping active unit check");
+ return 0;
+ }
if (r < 0)
return log_error_errno(r, "Failed to acquire bus: %m");