From 1e001f52d20a4685c9e8cf3cfa690021ca05c9e7 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 10 Jul 2010 04:50:19 +0200 Subject: [PATCH] main: add a few more useful diagnostic log messages --- src/dbus.c | 31 +++++++++++++++++++------------ src/manager.c | 6 +++++- src/unit.c | 3 +++ 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/dbus.c b/src/dbus.c index 1620469e..7f8b6a05 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -338,10 +338,12 @@ static DBusHandlerResult api_bus_message_filter(DBusConnection *connection, DBus dbus_error_init(&error); - log_debug("Got D-Bus request: %s.%s() on %s", - dbus_message_get_interface(message), - dbus_message_get_member(message), - dbus_message_get_path(message)); + if (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_METHOD_CALL || + dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_SIGNAL) + log_debug("Got D-Bus request: %s.%s() on %s", + dbus_message_get_interface(message), + dbus_message_get_member(message), + dbus_message_get_path(message)); if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL, "Disconnected")) { log_error("Warning! API D-Bus connection terminated."); @@ -443,10 +445,13 @@ static DBusHandlerResult system_bus_message_filter(DBusConnection *connection, D dbus_error_init(&error); - log_debug("Got D-Bus request: %s.%s() on %s", - dbus_message_get_interface(message), - dbus_message_get_member(message), - dbus_message_get_path(message)); + if (m->api_bus != m->system_bus && + (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_METHOD_CALL || + dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_SIGNAL)) + log_debug("Got D-Bus request on system bus: %s.%s() on %s", + dbus_message_get_interface(message), + dbus_message_get_member(message), + dbus_message_get_path(message)); if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL, "Disconnected")) { log_error("Warning! System D-Bus connection terminated."); @@ -474,10 +479,12 @@ static DBusHandlerResult private_bus_message_filter(DBusConnection *connection, assert(message); assert(m); - log_debug("Got D-Bus request: %s.%s() on %s", - dbus_message_get_interface(message), - dbus_message_get_member(message), - dbus_message_get_path(message)); + if (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_METHOD_CALL || + dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_SIGNAL) + log_debug("Got D-Bus request: %s.%s() on %s", + dbus_message_get_interface(message), + dbus_message_get_member(message), + dbus_message_get_path(message)); if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL, "Disconnected")) shutdown_connection(m, connection); diff --git a/src/manager.c b/src/manager.c index 638ef2f4..a6432632 100644 --- a/src/manager.c +++ b/src/manager.c @@ -1768,6 +1768,8 @@ static int manager_start_target(Manager *m, const char *name, JobMode mode) { dbus_error_init(&error); + log_info("Activating special unit %s", name); + if ((r = manager_add_job_by_name(m, JOB_START, name, mode, true, &error, NULL)) < 0) log_error("Failed to enqueue %s job: %s", name, bus_error(&error, r)); @@ -1795,6 +1797,8 @@ static int manager_process_signal_fd(Manager *m) { return -errno; } + log_debug("Received SIG%s", strna(signal_to_string(sfsi.ssi_signo))); + switch (sfsi.ssi_signo) { case SIGCHLD: @@ -1905,7 +1909,7 @@ static int manager_process_signal_fd(Manager *m) { break; } - log_info("Got unhandled signal <%s>.", strsignal(sfsi.ssi_signo)); + log_warning("Got unhandled signal <%s>.", strna(signal_to_string(sfsi.ssi_signo))); } } } diff --git a/src/unit.c b/src/unit.c index a5f8712a..c287310a 100644 --- a/src/unit.c +++ b/src/unit.c @@ -970,6 +970,9 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns) { else if (UNIT_IS_ACTIVE_OR_RELOADING(os) && !UNIT_IS_ACTIVE_OR_RELOADING(ns)) u->meta.active_exit_timestamp = ts; + if (ns != os && ns == UNIT_MAINTENANCE) + log_notice("Unit %s entered maintenance state.", u->meta.id); + timer_unit_notify(u, ns); path_unit_notify(u, ns); -- 2.39.5