I am on unstable and since I updated a few days ago my laptop turns off when pressing the power button despite logind being set to suspend on a short power key
here’s my config to confirm I am not crazy
This worked normally last week
My desktop system is immediately shutting down when resuming from suspend using the power button (but not when resuming by pressing another key). The log shows systemd[1]: Received SIGRTMIN+4. and then systemd begins the shutdown process. This began for me after upgrading the kernel from 6.18.56 to 6.18.59.
See also:
opened 09:30AM - 23 Oct 26 UTC
0.kind: bug
6.topic: nixos
### Nixpkgs version
- Unstable (26.11)
### Describe the bug
After a recent sw… itch from 00455b0a3690d3f5dc61e9aef4277dc86235b73f to 5adc50831c259f87faeb09ddf930d43597197473, my laptop would shutdown when opening its lid during suspend.
Claude traced it to tiny_power_button - I unloaded that module and the behaviour was fixed. The regular power button still works.
What follows is Claude's generated bug report.
---
On a ThinkPad P14s (AMD, s2idle), every lid-open resume now immediately powers the machine off. This started after bumping nixpkgs from 00455b0 to 5adc508, which took linux from 6.18.53 to 6.18.57 (and systemd from 261.2 to 262).
PID 1 logs Received SIGRTMIN+4. with no sender PID at wake, then starts poweroff.target. Tracing signal:signal_generate for sig 38 → PID 1 shows the kernel is the sender:
kworker/6:0 => __send_signal_locked => do_send_sig_info => kill_pid_info_type
=> kill_cad_pid => acpi_ev_notify_dispatch => acpi_os_execute_deferred
kill_cad_pid from an ACPI notify is the tiny-power-button driver, and it is loaded and bound to both power buttons:
$ ls /sys/bus/acpi/drivers/tiny-power-button
LNXPWRBN:00 PNP0C0C:00
$ zcat /proc/config.gz | grep -E 'ACPI_BUTTON|TINY_POWER'
CONFIG_ACPI_BUTTON=m
CONFIG_ACPI_TINY_POWER_BUTTON=m
CONFIG_ACPI_TINY_POWER_BUTTON_SIGNAL=38
The regular button driver is also active; it now binds via the platform bus (/devices/platform/PNP0C0C:00), so the ACPI device is left free for tiny-power-button to autoload (its aliases are acpi*:LNXPWRBN:* and acpi*:PNP0C0C:*). The firmware's power-button notify on s2idle wake, which button treats as a wakeup, is turned by tiny-power-button into SIGRTMIN+4 to init.
Cause in nixpkgs
ACPI_TINY_POWER_BUTTON isn't set in pkgs/os-specific/linux/kernel/common-config.nix, so autoModules builds it as a module. Upstream intends it as an alternative to ACPI_BUTTON (depends on !ACPI_BUTTON), aimed at VMs without a userspace power-button handler. But with ACPI_BUTTON=m, !m evaluates to m, so both get built.
Suggested fix
In common-config.nix:
# Alternative to ACPI_BUTTON that signals init directly; with both built as
# modules it autoloads next to `button` and powers machines off on resume.
ACPI_TINY_POWER_BUTTON = no;
Workaround
boot.blacklistedKernelModules = [ "tiny_power_button" ];
Confirmed fixed on the affected machine. The real power key still works via logind and button.
System
- nixpkgs 5adc50831c259f87faeb09ddf930d43597197473 (26.11.20261020)
- linux 6.18.57, systemd 262
- Lenovo ThinkPad P14s (AMD), mem_sleep = s2idle
### Steps to reproduce
Set to same version as specified and suspend / resume using the lid switch.
### Expected behaviour
Resume
### Screenshots
_No response_
### Relevant log output
```console
Claude made a special service to trace the problem. Here's the output:
$ journalctl -b -1 -u trace-poweroff-signal
Oct 23 10:12:14 p14s systemd[1]: Started Trace poweroff signals sent to PID 1.
Oct 23 10:12:48 p14s trace-poweroff-signal-start[10077]: kworker/6:0-6408 [006] dn.1.>
Oct 23 10:12:48 p14s trace-poweroff-signal-start[10077]: kworker/6:0-6408 [006] dn.1.>
Oct 23 10:12:48 p14s trace-poweroff-signal-start[10077]: => trace_event_raw_event_signal_gen>
Oct 23 10:12:48 p14s trace-poweroff-signal-start[10077]: => __send_signal_locked
Oct 23 10:12:48 p14s trace-poweroff-signal-start[10077]: => send_signal_locked
Oct 23 10:12:48 p14s trace-poweroff-signal-start[10077]: => do_send_sig_info
Oct 23 10:12:48 p14s trace-poweroff-signal-start[10077]: => kill_pid_info_type
Oct 23 10:12:48 p14s trace-poweroff-signal-start[10077]: => kill_cad_pid
Oct 23 10:12:48 p14s trace-poweroff-signal-start[10077]: => acpi_ev_notify_dispatch
Oct 23 10:12:48 p14s trace-poweroff-signal-start[10077]: => acpi_os_execute_deferred
Oct 23 10:12:48 p14s trace-poweroff-signal-start[10077]: => process_one_work
Oct 23 10:12:48 p14s trace-poweroff-signal-start[10077]: => worker_thread
Oct 23 10:12:48 p14s trace-poweroff-signal-start[10077]: => kthread
Oct 23 10:12:48 p14s trace-poweroff-signal-start[10077]: => ret_from_fork
Oct 23 10:12:48 p14s trace-poweroff-signal-start[10077]: => ret_from_fork_asm
Oct 23 10:12:49 p14s systemd[1]: Stopping Trace poweroff signals sent to PID 1...
Oct 23 10:12:49 p14s systemd[1]: trace-poweroff-signal.service: Deactivated successfully.
Oct 23 10:12:49 p14s systemd[1]: Stopped Trace poweroff signals sent to PID 1.
```
### Additional context
_No response_
### System metadata
- system: `"x86_64-linux"`
- host os: `Linux 6.18.57, NixOS, 26.11 (Zokor), 26.11.20261020.5adc508`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.34.9`
- channels(root): `"nixos-22.11, nixos-unstable"`
- channels(andrew): `"home-manager, nixpkgs-unstable"`
- nixpkgs: `/nix/store/czb28i7a1wgf8bhd94yrv6ljlmqv8c03-source`
### Notify maintainers
---
**Note for maintainers:** Please tag this issue in your pull request description. (i.e. `Resolves #ISSUE`.)
### I assert that this issue is relevant for Nixpkgs
- [x] I assert that this is a bug and not a support request.
- [x] I assert that this is not a [duplicate of an existing issue](https://github.com/NixOS/nixpkgs/issues?q=is%3Aissue+label%3A%220.kind%3A+bug%22+label%3A%226.topic%3A+nixos%22).
- [x] I assert that I have read the [NixOS Code of Conduct](https://github.com/NixOS/.github/blob/master/CODE_OF_CONDUCT.md) and agree to abide by it.
- [x] I assert that I have read the [automation/AI policy](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#automationai-policy) and that this issue report complies with it.
### Is this issue important to you?
Add a :+1: [reaction] to [issues you find important].
[reaction]: https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/
[issues you find important]: https://github.com/NixOS/nixpkgs/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc
The most recent nixos-rebuild on my laptop had me confused because all of a sudden the power key would shut it down, even though prior to the rebuild it would be ignored as per my systemd.logind.settings.Login.HandlePowerKey = "ignore" setting
Logs showed SIGRTMIN+4 was sent, quick search turned up CONFIG_ACPI_TINY_POWER_BUTTON_SIGNAL , and hey it’s set to 38 AKA SIGRTMIN+4 in my kernel config. I unloaded the tiny_power_button module, blacklisted it, everything is normal again
Seems like this …