]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coredump: Don't log an error if D-Bus isn't running
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 6 Oct 2021 12:20:36 +0000 (13:20 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 6 Oct 2021 17:23:11 +0000 (02:23 +0900)
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.

src/coredump/coredumpctl.c

index d370de290af5a2b68b5dccc0cf9a9ff893439a7a..b7957921ef0c62dae6a78f9e38e8cd77f50a331e 100644 (file)
@@ -1180,6 +1180,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");