From b44594d0109823625ae200e904dfb58336e9ef05 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Sat, 1 Oct 2016 15:59:47 +0200 Subject: [PATCH 1/2] bus: Add sender name to bus activation log messages This clarifies Activating via systemd: service name='com.example.Example' unit='example.service' to Activating via systemd: service name='com.example.Example' unit='example.service' requested by ':1.23' (uid 1000 pid 123 comm "whatever-activat") Similarly for the non-systemd code paths. https://bugs.freedesktop.org/show_bug.cgi?id=68212 --- bus/activation.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/bus/activation.c b/bus/activation.c index c614d52..2c5ef9d 100644 --- a/bus/activation.c +++ b/bus/activation.c @@ -1965,9 +1965,11 @@ 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' requested by '%s' (%s)", service_name, - entry->systemd_service); + entry->systemd_service, + bus_connection_get_name (connection), + bus_connection_get_loginfo (connection)); /* Wonderful, systemd is connected, let's just send the msg */ retval = bus_dispatch_matches (activation_transaction, NULL, systemd, message, error); @@ -1975,9 +1977,11 @@ 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' requested by '%s' (%s)", service_name, - entry->systemd_service); + entry->systemd_service, + bus_connection_get_name (connection), + bus_connection_get_loginfo (connection)); /* systemd is not around, let's "activate" it. */ retval = bus_activation_activate_service (activation, NULL, activation_transaction, TRUE, message, "org.freedesktop.systemd1", error); @@ -2089,12 +2093,16 @@ 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' requested by '%s' (%s) (using servicehelper)", + service_name, + bus_connection_get_name (connection), + bus_connection_get_loginfo (connection)); else bus_context_log (activation->context, - DBUS_SYSTEM_LOG_INFO, "Activating service name='%s'", - service_name); + DBUS_SYSTEM_LOG_INFO, "Activating service name='%s' requested by '%s' (%s)", + service_name, + bus_connection_get_name (connection), + bus_connection_get_loginfo (connection)); dbus_error_init (&tmp_error); -- 2.7.4