TL;DR thinkpad_acpi is firing TP_HKEY_EV_HOTPLUG_DOCK and TP_HKEY_EV_HOTPLUG_UNDOCK (relevant messages appear in dmesg), but acpi_listen and kacpimon (and acpid) don't see them.


I'm running on a ThinkPad T430 (iGPU only, no nVidia card), with Ubuntu 18.04 server (which I install xorg and various other packages on manually). I wanted to run scripts (to handle docking and undocking) on certain ACPI events. I used this methodology: https://feeding.cloud.geek.nz/posts/hooking-into-docking-undocking-events-to-run-scripts/ with acpid. This worked great for a few hours, but now the script no longer fire, and acpi_listen no longer sees the relevant events at all.

I had installed and uninstalled a few packages between when it was working and when it was not, but did not manually modify any configurations myself. All of those packages have since been uninstalled. The specific packages were:

  • thermald
  • tlp
  • tp-smapi-dkms
  • thinkfan
  • linux-tools-common

These packages have all been removed since with apt remove --purge and I have rebooted several times since then.

I'm hoping someone on here could suggest what services might be catching those events and preventing acpid from grabbing them?

I have already tried manually stopping the systemd-logind service, and this has no effect -- the relevant events still do not appear in acpi_listen or kacpimon. This problem seems to only effect the dock events, as volume and brightness keys still produce events in both acpi_listen and kacpimon.

These are my observations so far:

  1. I see messages such as
[  849.503377] thinkpad_acpi: undocked from hotplug port replicator
[  982.631694] thinkpad_acpi: docked into hotplug port replicator

in dmesg, so presumably the acpi_thinkpad module is working.

  1. I see messages in acpi_listen when I do other things that would cause events. For example, pressing volume up produces this output:
button/volumeup VOLUP 00000080 00000000 K

presumably, acpid is functioning correctly. Output from kacpimon was consistent with this behavior (also missing dock/undock events).

  1. As noted, I tried stopping systemd-logind and testing the previous again, with no effect. I am insufficently knowledgeable about systemd to be sure of weather or not that was adequate to stop it from intercepting all acpi events though?

  2. This is the contents of /proc/acpi/ibm/hotkey

status:         enabled
mask:           0x078c7ffb
commands:       enable, disable, reset, <mask>

This is identical to the contents of this file when booted from a live CD, and with the value in /sys/devices/platform/thinkpad_acpi/hotkey_recommended_mask. As noted in (1), this suggests that the acpi_thinkpad module is working and generating the right events.

  1. Booting from a live CD (Xubuntu 18.04, which I had handy) and running acpi_listen, then docking/undocking causes the expected events to be printed.

In conclusion, I have presumably somehow gotten my system into a state where something is capturing / masking these particular ACPI events before acpid can get them.

Can anyone suggest what might be the source of this issue? An alternative method for triggering scripts to run on dock/undock would work too.


You must log in to answer this question.

Browse other questions tagged .