FS#21767 - [acpid] handler script checks for the wrong event name

Attached to Project: Arch Linux
Opened by Brad Conte (B-Con) - Sunday, 21 November 2010, 05:30 GMT
Last edited by Andrea Scarpino (BaSh) - Tuesday, 17 May 2011, 17:27 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Thomas Bächler (brain0)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Description:
In /etc/acpi/handler.sh, the event that is checked for to handle the change of AC power status checks for the wrong event name, at least on my machine. The first parameter is "ac_adapter", but the second parameter is "AC", whereas in my test runs I see "ACAD" as that parameter, thus the block of code to handle AC power status changes is never executed.

Also, the contends of /proc/acpi/ac_adapter only contains "ACAD", no "AC". If memory serves, it used to be "AC", so maybe this script just uses out-of-date names. If this is the case, there could be other instances in the package where the old names are used that I haven't tripped across yet.


Additional info:
* acpid 1.1.10-3
* /etc/acpi/handler.sh


Steps to reproduce:
* Add "touch /tmp/t" at line 31 in /etc/acpi/handler.sh (under: case $2, AC, case $4).
* Add "echo "$*" > /tmp/args" at line 12, before the "case" statement.
* Unplug and replug the AC adapter.
* Note the lack of /tmp/t.
* Note that argument 2 in /tmp/args is "ACAD", not "AC".
This task depends upon

Closed by  Andrea Scarpino (BaSh)
Tuesday, 17 May 2011, 17:27 GMT
Reason for closing:  Fixed
Additional comments about closing:  acpid 2.0.9-1
Comment by Jan de Groot (JGC) - Monday, 22 November 2010, 16:56 GMT
On my laptop there's a /proc/acpi/ac_adapter/AC, so the ACAD is limited to specific cases.
Comment by Brad Conte (B-Con) - Tuesday, 23 November 2010, 19:36 GMT
Interesting, Jan. I assume that the existence of AC and ACAD are mutually exclusive, so it seems the solution then may be to condition the case statement on "AC|ACAD" so that both are accepted.
Comment by John Lindgren (jlindgren) - Saturday, 05 March 2011, 08:38 GMT
Similar problem here; only instead of "ACAD" I have "ADP0".
Comment by Eric Belanger (Snowman) - Saturday, 14 May 2011, 03:00 GMT
I'm looking in updating the package to acpid2 2.0.9.
Thomas, Jan : any objections in replacing the AC case in handler.sh by AC|ACAD|ADP0 ?
Comment by Andrea Scarpino (BaSh) - Sunday, 15 May 2011, 11:12 GMT
I replaced AC with AC|ACAD|ADP0 in acpid-2.0.9-2 in [testing]

Loading...