From bf135d82585f9a6356fa818fe4c130d3e3524918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 10 Oct 2020 09:49:28 +0200 Subject: [PATCH 1/2] logind: print what action is ignored My logs have lines like this: Oct 10 09:38:38 krowka systemd-logind[1889]: External (2) displays connected. Oct 10 09:38:38 krowka systemd-logind[1889]: Refusing operation, as it is turned off. Without some hint *what* operation is ignored, this is not very informative. (I remember this came up before, but I don't remember why we didn't change this log line back then...) --- src/login/logind-action.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/login/logind-action.c b/src/login/logind-action.c index 140953eec1..1aeacfaf2b 100644 --- a/src/login/logind-action.c +++ b/src/login/logind-action.c @@ -64,7 +64,9 @@ int manager_handle_action( /* If the key handling is turned off, don't do anything */ if (handle == HANDLE_IGNORE) { - log_debug("Refusing operation, as it is turned off."); + log_debug("Handling of %s (%s) is disabled, taking no action.", + inhibit_key == 0 ? "idle timeout" : inhibit_what_to_string(inhibit_key), + is_edge ? "edge" : "level"); return 0; } From 43e94f86c0afb9a66624a42fc3102846042e1728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 10 Oct 2020 09:52:58 +0200 Subject: [PATCH 2/2] logind: fix taking of inhibitors Ooops made in 0a9bf7fa593682326f1c5c2d7ec3d29a9d59e5cb. --- src/login/logind-dbus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 01ffbb6bad..0f83ed99bc 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -3299,6 +3299,7 @@ static int method_inhibit(sd_bus_message *message, void *userdata, sd_bus_error r = inhibitor_start(i); if (r < 0) return r; + TAKE_PTR(i); return sd_bus_reply_method_return(message, "h", fifo_fd); }