lid event not recognized by acpi event rules

Bug #163265 reported by Giuseppe Benigno
6
Affects Status Importance Assigned to Milestone
acpi-support (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Binary package hint: acpi-support

I use Ubuntu 7.10
/etc/acpi/events/lidbtn non recognize my Toshiba m200 lid event.
I must replace in the /etc/acpi/events/lidbtn the line

"event=button[ /]lid" with "event=button[/]lid" and all ok.

My output of acpi_listen:
$ acpi_listen
 button/lid LID 00000080 0000000f
 button/lid LID 00000080 00000010

Regards

description: updated
description: updated
Revision history for this message
sillyxone (sillyxone) wrote :

Confirmed, my Dell D620 suspends on lid close in Feisty but not in Gutsy.

Edit the file as suggested, works right away after restarting

Revision history for this message
Giuseppe Benigno (giuseppe-benigno) wrote :

No need restart the box, it's enough write:

sudo /etc/init.d/acpid force-reload
sudo /etc/init.d/acpid restart

Revision history for this message
Daniel Hahler (blueyed) wrote :

Well, that's _very_ strange. "[ /]" should match "space or slash" and I've verified that acpid parses the event correctly and also that regexec matches "button/lid" given the event from /etc/acpi/events/lidbtn.

I've patched event.c, so that it tests each loaded event against "button/lid" and outputs the event in case it matches:
diff -u acpid-1.0.4/event.c acpid-1.0.4/event.c
--- acpid-1.0.4/event.c
+++ acpid-1.0.4/event.c
@@ -283,6 +283,11 @@
                                fclose(fp);
                                return NULL;
                        }
+ if (!regexec(r->event, "button/lid LID 00000080 0000000f", 0, NULL, 0)) {
+ printf("EVENT: '%s'\n", val);
+ printf("MATCH!\n");
+ }
+
                } else if (!strcasecmp(key, "action")) {
                        if (check_escapes(val) < 0) {
                                acpid_log("ERR: can't load file %s\n", file);
Then compiled it just using "make" and started it in debug mode ("./acpid -d") and part of the output confirmed the match:
[Wed Mar 26 23:48:50 2008] DBG: parsing conf file /etc/acpi/events/lidbtn
EVENT: 'button[ /]lid'
MATCH!

So, while I believe you that you experience this problem, of course, there appears to be some other problem.
Does it work for you if you use "event=button[/ ]lid" (changing the order of space and slash)?
Another possibility would be to try "event=button[/[:space:]]lid".

btw: "sudo invoke-rc.d acpid restart" should be enough to reload acpid.

Changed in acpi-support:
assignee: nobody → blueyed
status: New → Incomplete
Revision history for this message
Daniel Hahler (blueyed) wrote :

This probably affects "events/sleepbtn" in the same way, which uses "event=button[ /]sleep".

Phillip Susi (psusi)
Changed in acpi-support (Ubuntu):
assignee: Daniel Hahler (blueyed) → nobody
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.