main: add a few more useful diagnostic log messages

This commit is contained in:
Lennart Poettering 2010-07-10 04:50:19 +02:00
parent 2e22afe909
commit 1e001f52d2
3 changed files with 27 additions and 13 deletions

View File

@ -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);

View File

@ -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)));
}
}
}

View File

@ -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);