You are not logged in.

#1 2014-06-17 10:03:24

rosenrot
Member
Registered: 2013-04-23
Posts: 6

Problems with acpid

Hi,
okay first I want to try to explain my situation. Im using Arch for a while but had (all the time) a problem with acpid. Whatever I write in /etc/handler.sh has no effect on the behaviour. Also scripts in /etc/acpid/events/ have noe effect. So I tried to find a work around when I begun using Arch and so wrote a service script for systemd which enabled my screenlock button. It worked quite well, not perfectly but well. Now I had some time and thought I could now try to fix the issue because I have a little more experience but I can't get it done.
The strange thing is, that although I disabled  the service (slock.service) the screenlock still runs the same way. I cant exclude I did something else to get the lock working but honestly I have no clue what that could be.

When I lock the screen journalctl -f does not show anything.

    button/screenlock)
        case "$2" in
            SCRNLCK)
                logger "SCRNLCK"
                ;;
            *)
                ::
        esac
        ;;

acpi_listen shows:

button/screenlock SCRNLCK 00000080 00000000 K


Here is my whole handler.sh:

#!/bin/bash
# Default acpi script that takes an entry for all actions

case "$1" in
    button/screenlock)
        logger "button/screenlock"
        case "$2" in
            SCRNLCK)
                logger "SCRNLCK lock"
                ;;
            *)
                ::
        esac
        ;;
    button/mute)
      case "$2" in
            MUTE)
                /bin/amixer set Master toggle
                ;;
            *)
                ;;
       esac
       ;;
    button/power)
        case "$2" in
            PBTN|PWRF)
                logger 'PowerButton pressed'
                ;;
            *)
                logger "ACPI action undefined: $2
                ;;
        esac
        ;;
    button/volumeup)
        case "$2" in
            VOLUP)
                /usr/bin/amixer set Master $step+
                ;;
            *)
                ;;
         esac
         ;;
    button/volumedown)
        case "$2" in
            VOLDN)
                /usr/bin/amixer set Master $step-
                ;;
            *)
                ;;
         esac
         ;;
    button/sleep)
        case "$2" in
            SLPB|SBTN)
                logger 'SleepButton pressed' &&
                systemctl suspend
                ;;
            *)
                logger "ACPI action undefined: $2"
                ;;
        esac
        ;;
    ac_adapter)
        case "$2" in
            AC|ACAD|ADP0)
                case "$4" in
                    00000000)
                        logger 'AC unpluged'
                        ;;
                    00000001)
                        logger 'AC pluged'
                        ;;
                esac
                ;;
            *)
                logger "ACPI action undefined: $2"
                ;;
        esac
        ;;
    battery)
        case "$2" in
            BAT0)
                case "$4" in
                    00000000)
                        logger 'Battery online'
                        ;;
                    00000001)
                        logger 'Battery offline'
                        ;;
                esac
                ;;
            CPU0)
                ;;
            *)  logger "ACPI action undefined: $2" ;;
        esac
        ;;
    button/lid)
        case "$3" in
            close)
                logger 'LID closed' &&
                systemctl suspend
                ;;
            open)
                logger 'LID opened'
                ;;
            *)
                logger "ACPI action undefined: $3"
                ;;
    esac
    ;;
    *)
        logger "ACPI group/action undefined: $1 / $2"
        ;;
esac

# vim:set ts=4 sw=4 ft=sh et:

Greetings
Rosenrot

Edit:
I forgot to mention acpid.service is running.

Last edited by rosenrot (2014-06-17 10:09:31)

Offline

#2 2014-06-17 19:44:09

rosenrot
Member
Registered: 2013-04-23
Posts: 6

Re: Problems with acpid

is my quesion silly or does no one know an answer? Did I configure some thing wrong? I really read the wiki page but couldn't find the answer,

Offline

#3 2014-06-17 20:03:57

rebootl
Member
Registered: 2012-01-10
Posts: 431
Website

Re: Problems with acpid

The handler.sh look allright to me.
Do you have the ruleset set to pass all the events to the handler.sh script ? (I think it's the default.)

Are any of the other events logged ? (like AC plug/unplug)


Personal website: reboot.li
GitHub: github.com/rebootl

Offline

#4 2014-06-17 21:21:57

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: Problems with acpid

rosenrot wrote:

The strange thing is, that although I disabled  the service (slock.service) the screenlock still runs the same way. I cant exclude I did something else to get the lock working but honestly I have no clue what that could be.

In addition to enabling the service you either rebooted or started the service, so now you have to either reboot or stop the service.

Offline

#5 2014-06-18 17:12:09

rosenrot
Member
Registered: 2013-04-23
Posts: 6

Re: Problems with acpid

@rebootl:
yes I have a handler:

# Pass all events to our one handler script
event=.*
action=/etc/acpi/handler.sh %e

When I press the screenlock button nothing is logged.
When closing the lid the computer suspends and this is getting logged (the suspend runs over systemd when im right; there is no log from my handler).
Here is the output:

Jun 18 19:06:54 localhost systemd-logind[294]: Lid closed.
Jun 18 19:06:54 localhost systemd-logind[294]: Suspending...
Jun 18 19:06:54 localhost systemd[1]: Starting Sleep.
Jun 18 19:06:54 localhost systemd[1]: Reached target Sleep.
Jun 18 19:06:54 localhost systemd[1]: Starting Suspend...
Jun 18 19:06:55 localhost systemd-sleep[21946]: Suspending system...
Jun 18 19:07:01 localhost kernel: PM: Syncing filesystems ... done.
Jun 18 19:07:01 localhost kernel: PM: Preparing system for mem sleep
Jun 18 19:07:01 localhost kernel: Freezing user space processes ... (elapsed 0.001 seconds) done.
Jun 18 19:07:01 localhost kernel: Freezing remaining freezable tasks ... (elapsed 0.000 seconds) done.
Jun 18 19:07:01 localhost kernel: PM: Entering mem sleep
Jun 18 19:07:01 localhost kernel: Suspending console(s) (use no_console_suspend to debug)
Jun 18 19:07:01 localhost kernel: wls1: deauthenticating from a0:ec:80:e8:3b:c4 by local choice (reason=3)
Jun 18 19:07:01 localhost kernel: cfg80211: Calling CRDA for country: DE
Jun 18 19:07:01 localhost kernel: sd 2:0:0:0: [sda] Synchronizing SCSI cache
Jun 18 19:07:01 localhost kernel: sd 2:0:0:0: [sda] Stopping disk
Jun 18 19:07:01 localhost kernel: PM: suspend of devices complete after 493.012 msecs
Jun 18 19:07:01 localhost kernel: PM: late suspend of devices complete after 13.341 msecs
Jun 18 19:07:01 localhost kernel: ehci-pci 0000:00:1d.7: System wakeup enabled by ACPI
Jun 18 19:07:01 localhost kernel: uhci_hcd 0000:00:1d.0: System wakeup enabled by ACPI
Jun 18 19:07:01 localhost kernel: ehci-pci 0000:00:1a.7: System wakeup enabled by ACPI
Jun 18 19:07:01 localhost kernel: uhci_hcd 0000:00:1a.2: System wakeup enabled by ACPI
Jun 18 19:07:01 localhost kernel: uhci_hcd 0000:00:1a.0: System wakeup enabled by ACPI
Jun 18 19:07:01 localhost kernel: e1000e 0000:00:19.0: System wakeup enabled by ACPI
Jun 18 19:07:01 localhost kernel: PM: noirq suspend of devices complete after 66.649 msecs
Jun 18 19:07:01 localhost kernel: ACPI: Preparing to enter system sleep state S3
Jun 18 19:07:01 localhost kernel: PM: Saving platform NVS memory
Jun 18 19:07:01 localhost kernel: Disabling non-boot CPUs ...
Jun 18 19:07:01 localhost kernel: kvm: disabling virtualization on CPU1
Jun 18 19:07:01 localhost kernel: smpboot: CPU 1 is now offline
Jun 18 19:07:01 localhost kernel: ACPI: Low-level resume complete
Jun 18 19:07:01 localhost kernel: PM: Restoring platform NVS memory
Jun 18 19:07:01 localhost kernel: Enabling non-boot CPUs ...
Jun 18 19:07:01 localhost kernel: x86: Booting SMP configuration:
Jun 18 19:07:01 localhost kernel: smpboot: Booting Node 0 Processor 1 APIC 0x1
Jun 18 19:07:01 localhost kernel: Disabled fast string operations
Jun 18 19:07:01 localhost kernel: kvm: enabling virtualization on CPU1
Jun 18 19:07:01 localhost kernel: CPU1 is up
Jun 18 19:07:01 localhost kernel: ACPI: Waking up from system sleep state S3
Jun 18 19:07:01 localhost kernel: uhci_hcd 0000:00:1a.0: System wakeup disabled by ACPI
Jun 18 19:07:01 localhost kernel: uhci_hcd 0000:00:1a.2: System wakeup disabled by ACPI
Jun 18 19:07:01 localhost kernel: ehci-pci 0000:00:1a.7: System wakeup disabled by ACPI
Jun 18 19:07:01 localhost kernel: uhci_hcd 0000:00:1d.0: System wakeup disabled by ACPI
Jun 18 19:07:01 localhost kernel: ehci-pci 0000:00:1d.7: System wakeup disabled by ACPI
Jun 18 19:07:01 localhost kernel: PM: noirq resume of devices complete after 130.737 msecs
Jun 18 19:07:01 localhost kernel: PM: early resume of devices complete after 0.257 msecs
Jun 18 19:07:01 localhost kernel: mei_me 0000:00:03.0: irq 44 for MSI/MSI-X
Jun 18 19:07:01 localhost kernel: e1000e 0000:00:19.0: System wakeup disabled by ACPI
Jun 18 19:07:01 localhost kernel: e1000e 0000:00:19.0: irq 46 for MSI/MSI-X
Jun 18 19:07:01 localhost kernel: usb usb1: root hub lost power or was reset
Jun 18 19:07:01 localhost kernel: usb usb2: root hub lost power or was reset
Jun 18 19:07:01 localhost kernel: usb usb3: root hub lost power or was reset
Jun 18 19:07:01 localhost kernel: snd_hda_intel 0000:00:1b.0: irq 48 for MSI/MSI-X
Jun 18 19:07:01 localhost kernel: usb usb4: root hub lost power or was reset
Jun 18 19:07:01 localhost kernel: usb usb5: root hub lost power or was reset
Jun 18 19:07:01 localhost kernel: usb usb6: root hub lost power or was reset
Jun 18 19:07:01 localhost kernel: pciehp 0000:00:1c.1:pcie04: Device 0000:03:00.0 already exists at 0000:03:00, cannot hot-add
Jun 18 19:07:01 localhost kernel: pciehp 0000:00:1c.1:pcie04: Cannot add device at 0000:03:00
Jun 18 19:07:01 localhost kernel: ata4: SATA link down (SStatus 0 SControl 300)
Jun 18 19:07:01 localhost kernel: ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
Jun 18 19:07:01 localhost kernel: ata3.00: ACPI cmd ef/02:00:00:00:00:a0 (SET FEATURES) succeeded
Jun 18 19:07:01 localhost kernel: ata3.00: ACPI cmd f5/00:00:00:00:00:a0 (SECURITY FREEZE LOCK) filtered out
Jun 18 19:07:01 localhost kernel: ata3.00: ACPI cmd ef/5f:00:00:00:00:a0 (SET FEATURES) succeeded
Jun 18 19:07:01 localhost kernel: ata3.00: ACPI cmd ef/10:03:00:00:00:a0 (SET FEATURES) filtered out
Jun 18 19:07:01 localhost kernel: ata3.00: ACPI cmd ef/02:00:00:00:00:a0 (SET FEATURES) succeeded
Jun 18 19:07:01 localhost kernel: ata3.00: ACPI cmd f5/00:00:00:00:00:a0 (SECURITY FREEZE LOCK) filtered out
Jun 18 19:07:01 localhost kernel: ata3.00: ACPI cmd ef/5f:00:00:00:00:a0 (SET FEATURES) succeeded
Jun 18 19:07:01 localhost kernel: ata3.00: ACPI cmd ef/10:03:00:00:00:a0 (SET FEATURES) filtered out
Jun 18 19:07:01 localhost kernel: ata3.00: configured for UDMA/133
Jun 18 19:07:01 localhost kernel: sd 2:0:0:0: [sda] Starting disk
Jun 18 19:07:01 localhost kernel: iwlwifi 0000:03:00.0: L1 Disabled; Enabling L0S
Jun 18 19:07:01 localhost kernel: iwlwifi 0000:03:00.0: Radio type=0x0-0x2-0x0
Jun 18 19:07:01 localhost kernel: PM: resume of devices complete after 2101.133 msecs
Jun 18 19:07:01 localhost kernel: PM: Finishing wakeup.
Jun 18 19:07:01 localhost kernel: Restarting tasks ... done.
Jun 18 19:07:01 localhost kernel: video LNXVIDEO:00: Restoring backlight state


Are this lines important?

Jun 18 19:07:01 localhost kernel: pciehp 0000:00:1c.1:pcie04: Device 0000:03:00.0 already exists at 0000:03:00, cannot hot-add
Jun 18 19:07:01 localhost kernel: pciehp 0000:00:1c.1:pcie04: Cannot add device at 0000:03:00


@Raynman:
I rebooted and the lock is still working.

PS: are you happy with quoting such logs or do you want them with code tags, that it could be scrolled?


EDIT:
Ok I see when plugging the cable this is getting logged:

Jun 18 19:12:40 localhost kernel: thinkpad_acpi: EC reports that Thermal Table has changed
Jun 18 19:12:44 localhost kernel: thinkpad_acpi: EC reports that Thermal Table has changed

could it be that the thinkpad_acpi overrides something from the "normal" one?

Last edited by rosenrot (2014-06-18 17:14:06)

Offline

#6 2014-06-18 19:46:52

rebootl
Member
Registered: 2012-01-10
Posts: 431
Website

Re: Problems with acpid

PS: are you happy with quoting such logs or do you want them with code tags, that it could be scrolled?

Yes, please edit to use code tags for the logs and such.

could it be that the thinkpad_acpi overrides something from the "normal" one?

Ok but that too doesn't look like the output from your handler script, there it says e.g.: logger 'Battery online'.
Honestly, I don't know where exactly the problem is, unfortunately.
I think it could be some sort of conflict, as you assumed, I think that would be the right direction to investigate further...

Regards


Personal website: reboot.li
GitHub: github.com/rebootl

Offline

Board footer

Powered by FluxBB