[Pkg-acpi-devel] Bug#732277: Option for acpid to drop certain events completely

Pigeon pigeon at pigeonsnest.co.uk
Mon Dec 16 09:03:33 UTC 2013


Package: acpid
Version: 2.0.20-1
Severity: wishlist
Tags: patch

It is sometimes desirable to configure acpid to ignore certain events
completely, such that no processing is carried out upon them at all.
Unfortunately the standard configuration options do not allow this.

There is a problem with acpid on certain laptops which generate
periodic spurious battery insertion/removal events at short intervals.
For example, with acpid event logging turned on I get:

  Dec 16 05:29:44 laptop acpid: received netlink event "battery PNP0C0A:00 00000080 00000001"

in my syslog every 16-17 seconds or so (sometimes double that).

Googling on the subject indicates that while it is a fairly uncommon
problem, it is one that has been cropping up every now and then for as
long as acpid has existed, and there seems to be no solution, no hint
as to the cause, nor even any certainty as to whether it is the laptop
or the battery itself which is causing it - I found a few mentions of
the problem having been cured by replacing an ageing battery, but on
the other hand I get periodic battery insertion events (as above) with
both a nearly dead and a brand new battery installed, and periodic
battery removal events (as above but with final dword 00000000) with
the battery removed.

The frequency of these spurious events causes diverse difficulties
with power management as they trigger processing by various acpid
clients, which may in turn cause disk access and prevent the hard
drive from being powered down. It seems fairly common for power
management software to misinterpret "battery inserted" as being the
same as "external power disconnected" (which is a separate ACPI event
in its owm right) and switch the machine to low power mode, causing a
message to be written to syslog to say that this has happened every
few seconds and keeping the hard drive running. Indeed the comments in
/etc/acpi/events/battery and /etc/acpi/events/ac seem to present a
variant of this error.

There would seem to be no particular difficulty likely to arise from
dropping the battery insertion/removal events entirely since even if
they were working properly they would not be of significant value; to
be notified when the battery is inserted or removed is not very 
useful. If the laptop is running on external power it makes no 
difference; if it is not, nothing will be notified of battery removal
anyway...

Unfortunately there is no way to configure acpid to ignore an event
entirely; it is only possible to add extra responses by means of
external programs called through files in /etc/acpi/events. Other
external programs which connect to acpid via /var/run/acpid.socket and
submit rules which match the event in question will still receive it,
and this cannot be prevented without drastic measures.

I have therefore patched acpid to accept a pseudo-action - by default
DIEDIEDIE but configurable via a command-line option - which causes it
to abort all processing of an event. So for example the following can
be put in /etc/acpi/events/battery:

event=battery.*
action=DIEDIEDIE

and the spurious battery events will be dropped and not passed to any
clients.

Patch is attached.

-- 
Pigeon

Be kind to pigeons        - -        Pigeon's Nest: http://pigeonsnest.co.uk/
GPG key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x21C61F7F
-------------- next part --------------
A non-text attachment was scrubbed...
Name: acpid.2.0.20.kill-events.patch
Type: text/x-diff
Size: 5084 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-acpi-devel/attachments/20131216/731d8238/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-acpi-devel/attachments/20131216/731d8238/attachment.sig>


More information about the Pkg-acpi-devel mailing list