diff --git a/dbus.spec b/dbus.spec index 3360435a8289da2304c1fed81670f27fd879547d..ebf2232956ad85dac3261d05750ba13d5f7c720d 100644 --- a/dbus.spec +++ b/dbus.spec @@ -1,7 +1,7 @@ Name: dbus Epoch: 1 Version: 1.12.16 -Release: 17 +Release: 18 Summary: System Message Bus License: AFLv3.0 or GPLv2+ URL: http://www.freedesktop.org/Software/dbus/ @@ -9,6 +9,7 @@ Source0: https://dbus.freedesktop.org/releases/dbus/%{name}-%{version}.tar.gz Source1: 00-start-message-bus.sh Patch0001: bugfix-let-systemd-restart-dbus-when-the-it-enters-failed.patch +Patch0002: print-load-average-when-activate-service-timeout.patch # fix CVE-2020-12049 Patch6000: sysdeps-unix-On-MSG_CTRUNC-close-the-fds-we-did-rece.patch @@ -231,6 +232,9 @@ fi %exclude %{_pkgdocdir}/README %changelog +* Mon Nov 29 2021 jiangchuangang - 1:1.12.16-18 +- add print-load-average-when-activate-service-timeout.patch for more debug information + * Wed Mar 24 2021 Anakin Zhang - 1:1.12.16-17 - change dbus group ID to 81 diff --git a/print-load-average-when-activate-service-timeout.patch b/print-load-average-when-activate-service-timeout.patch new file mode 100644 index 0000000000000000000000000000000000000000..454e71ad79c6f6da9658ebedba406657c5f31207 --- /dev/null +++ b/print-load-average-when-activate-service-timeout.patch @@ -0,0 +1,82 @@ +From 9dfd892ec5e999cd5f2745b9f29ecd9dca805e25 Mon Sep 17 00:00:00 2001 +From: const +Date: Mon, 29 Nov 2021 16:50:46 +0800 +Subject: [PATCH] print load average when activate service timeout + +--- + bus/activation.c | 29 +++++++++++++++++++++++++++-- + 1 file changed, 27 insertions(+), 2 deletions(-) + +diff --git a/bus/activation.c b/bus/activation.c +index 99404b9..486ec2e 100644 +--- a/bus/activation.c ++++ b/bus/activation.c +@@ -24,6 +24,7 @@ + */ + + #include ++#include + #include "activation.h" + #include "activation-exit-codes.h" + #include "config-parser.h" +@@ -43,6 +44,8 @@ + #include + #endif + ++#define LOADAVG_LEN_MAX 256 ++ + struct BusActivation + { + int refcount; +@@ -1527,12 +1530,32 @@ toggle_babysitter_watch (DBusWatch *watch, + } + + static dbus_bool_t ++read_loadavg (char *load_avg) ++{ ++ FILE *fp; ++ int rc; ++ ++ if ((fp = fopen("/proc/loadavg", "r")) == NULL) ++ return FALSE; ++ ++ rc = fscanf(fp, "%[^\n]", load_avg); ++ ++ fclose(fp); ++ ++ if (rc < 1) ++ return FALSE; ++ ++ return TRUE; ++} ++ ++static dbus_bool_t + pending_activation_timed_out (void *data) + { + BusPendingActivation *pending_activation = data; + BusContext *context; + DBusError error; + int timeout; ++ char load_avg[LOADAVG_LEN_MAX] = ""; + + context = pending_activation->activation->context; + timeout = bus_context_get_activation_timeout (context); +@@ -1546,11 +1569,13 @@ pending_activation_timed_out (void *data) + + dbus_error_init (&error); + ++ (void)read_loadavg(load_avg); ++ + bus_context_log_and_set_error (context, DBUS_SYSTEM_LOG_WARNING, &error, + DBUS_ERROR_TIMED_OUT, + "Failed to activate service '%s': timed out " +- "(service_start_timeout=%dms)", +- pending_activation->service_name, timeout); ++ "(service_start_timeout=%dms), load average: %s", ++ pending_activation->service_name, timeout, load_avg); + + pending_activation_failed (pending_activation, &error); + +-- +1.8.3.1 +