Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1154323

Bug#1040943: systemd-logind: 'HandlePowerKey=ignore' works in logind.conf, not in logind.conf.d/custom.conf

From Diederik de Haas <didi.debian@cknow.org>
Newsgroups linux.debian.bugs.dist
Subject Bug#1040943: systemd-logind: 'HandlePowerKey=ignore' works in logind.conf, not in logind.conf.d/custom.conf
Date 2023-07-15 12:00 +0200
Message-ID <GRKed-ntZ-7@gated-at.bofh.it> (permalink)
References <GQN4t-eJf-5@gated-at.bofh.it> <GR88V-uLQ-3@gated-at.bofh.it> <GR8Vj-vhA-3@gated-at.bofh.it> <GQN4t-eJf-5@gated-at.bofh.it> <GR8Vj-vhA-3@gated-at.bofh.it>
Organization Connecting Knowledge

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Control: retitle -1 With HandlePowerKeyLongPress=shutdown configured, a short press is interpreted as long press

On Thursday, 13 July 2023 20:00:54 CEST Diederik de Haas wrote:
> > > When I created /etc/systemd/logind.conf.d/custom.conf with
> > > HandlePowerKey=ignore
> > 
> > If this is the whole content of /etc/systemd/logind.conf.d/custom.conf,
> > you are missing a [Login] section at the top of the file
> 
> It was the whole contents.
> Adding the "[Login]" header (back) made it work \o/
> 
> I initially had that header, but in my attempts to get it to work, I removed
> it again. I must have done something else wrong in my earlier attempts
> which made it not work then, but I won't be able to recall exactly what.

It looks like there actually is a bug and not (just) a PEBKAC issue.
What I (actually) started out with, was the following custom config:
```
[Login]
HandlePowerKey=suspend
HandlePowerKeyLongPress=poweroff
```

And when I then pressed the power key *short*, it powered off the system.
My initial conclusion that logind.conf.d/custom.conf didn't work was incorrect.

If I remove or disable (via prepending it with '#') the LongPress action, then
it sees it as a short key press and does the desired thing: suspend.
If I set the LongPress action to 'ignore', then it also registers a short key
press as a short press and does the desired thing: suspend.
But if I set the LongPress action to 'shutdown', then it registers a short key
press as a *long* press and does the poweroff action.

Attached you'll find the custom config I used (same as quoted above) and
also the output from journalctl where all my physical key presses were short.

Back to linux.debian.bugs.dist | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Bug#1040943: systemd-logind: 'HandlePowerKey=ignore' works in logind.conf, not in logind.conf.d/custom.conf Diederik de Haas <didi.debian@cknow.org> - 2023-07-12 20:50 +0200
  Bug#1040943: systemd-logind: 'HandlePowerKey=ignore' works in logind.conf, not in logind.conf.d/custom.conf Michael Biebl <biebl@debian.org> - 2023-07-13 19:20 +0200
  Bug#1040943: marked as done (systemd-logind: 'HandlePowerKey=ignore' works in logind.conf, not in logind.conf.d/custom.conf) Michael Biebl <biebl@debian.org> - 2023-07-13 20:10 +0200
    Bug#1040943: systemd-logind: 'HandlePowerKey=ignore' works in logind.conf, not in logind.conf.d/custom.conf Diederik de Haas <didi.debian@cknow.org> - 2023-07-14 00:40 +0200
  Bug#1040943: systemd-logind: 'HandlePowerKey=ignore' works in logind.conf, not in logind.conf.d/custom.conf Diederik de Haas <didi.debian@cknow.org> - 2023-07-15 12:00 +0200
    Bug#1040943: systemd-logind: 'HandlePowerKey=ignore' works in logind.conf, not in logind.conf.d/custom.conf Diederik de Haas <didi.debian@cknow.org> - 2023-07-15 12:10 +0200
    Bug#1040943: systemd-logind: 'HandlePowerKey=ignore' works in logind.conf, not in logind.conf.d/custom.conf Michael Biebl <biebl@debian.org> - 2023-07-17 01:30 +0200
      Bug#1040943: systemd-logind: 'HandlePowerKey=ignore' works in logind.conf, not in logind.conf.d/custom.conf Diederik de Haas <didi.debian@cknow.org> - 2023-07-17 02:10 +0200
        Bug#1040943: systemd-logind: 'HandlePowerKey=ignore' works in logind.conf, not in logind.conf.d/custom.conf Michael Biebl <biebl@debian.org> - 2023-07-17 07:50 +0200

csiph-web