From 75abb458e28ca4aa49764b9817662d08dd2b01e3 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Sat, 1 Oct 2016 15:59:47 +0200 Subject: [PATCH] bus: Add sender name to systemd bus activation log messages This clarifies Activating via systemd: service name='A' unit='B' to Activating via systemd: service name='A' unit='B' sender='blah' https://bugs.freedesktop.org/show_bug.cgi?id=68212 --- bus/activation.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/bus/activation.c b/bus/activation.c index c614d52..663ca18 100644 --- a/bus/activation.c +++ b/bus/activation.c @@ -1965,9 +1965,10 @@ bus_activation_activate_service (BusActivation *activation, if (service != NULL) { bus_context_log (activation->context, - DBUS_SYSTEM_LOG_INFO, "Activating via systemd: service name='%s' unit='%s'", + DBUS_SYSTEM_LOG_INFO, "Activating via systemd: service name='%s' unit='%s' sender='%s'", service_name, - entry->systemd_service); + entry->systemd_service, + dbus_message_get_sender (activation_message)); /* Wonderful, systemd is connected, let's just send the msg */ retval = bus_dispatch_matches (activation_transaction, NULL, systemd, message, error); @@ -1975,9 +1976,10 @@ bus_activation_activate_service (BusActivation *activation, else { bus_context_log (activation->context, - DBUS_SYSTEM_LOG_INFO, "Activating systemd to hand-off: service name='%s' unit='%s'", + DBUS_SYSTEM_LOG_INFO, "Activating systemd to hand-off: service name='%s' unit='%s' sender='%s'", service_name, - entry->systemd_service); + entry->systemd_service, + dbus_message_get_sender (activation_message)); /* systemd is not around, let's "activate" it. */ retval = bus_activation_activate_service (activation, NULL, activation_transaction, TRUE, message, "org.freedesktop.systemd1", error); @@ -1988,9 +1990,10 @@ bus_activation_activate_service (BusActivation *activation, if (!retval) { bus_context_log (activation->context, - DBUS_SYSTEM_LOG_INFO, "Failed to activate via systemd: service name='%s' unit='%s'", + DBUS_SYSTEM_LOG_INFO, "Failed to activate via systemd: service name='%s' unit='%s' sender='%s'", service_name, - entry->systemd_service); + entry->systemd_service, + dbus_message_get_sender (activation_message)); _DBUS_ASSERT_ERROR_IS_SET (error); _dbus_verbose ("failed to send activation message: %s\n", error->name); bus_transaction_cancel_and_free (activation_transaction); @@ -2089,12 +2092,14 @@ bus_activation_activate_service (BusActivation *activation, _dbus_verbose ("Spawning %s ...\n", argv[0]); if (servicehelper != NULL) bus_context_log (activation->context, - DBUS_SYSTEM_LOG_INFO, "Activating service name='%s' (using servicehelper)", - service_name); + DBUS_SYSTEM_LOG_INFO, "Activating service name='%s' sender='%s' (using servicehelper)", + service_name, + dbus_message_get_sender (activation_message)); else bus_context_log (activation->context, - DBUS_SYSTEM_LOG_INFO, "Activating service name='%s'", - service_name); + DBUS_SYSTEM_LOG_INFO, "Activating service name='%s' sender='%s'", + service_name, + dbus_message_get_sender (activation_message)); dbus_error_init (&tmp_error); -- 2.7.4