]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
logind: print what action is ignored
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 10 Oct 2020 07:49:28 +0000 (09:49 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 10 Oct 2020 07:58:47 +0000 (09:58 +0200)
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

index 140953eec104afe107b581f6be3e961634d16bef..1aeacfaf2bc5d82f35d9fd533ab9510dffea923e 100644 (file)
@@ -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;
         }