You are not logged in.

#1 2012-10-17 17:12:27

scott_fakename
Member
Registered: 2012-08-15
Posts: 92

[SOLVED] Suspend button no longer works after update

Recently update my system, and now pressing the suspend button (Fn+F3 in my case) doesn't suspend it to ram as it did before.

Running acpi_listen and hitting the button gives me the output "button/sleep SBTN 00000080 00000000 K" so clearly it's hearing it. Pressing the brightness buttons on the keyboard works (changes the brightness as expected), pressing the power button works to shut it down completely, closing the lid suspends it as expected... Just the suspend button stopped working.

I saw a post about a different thing which mentioned systemd's config file "/etc/systemd/logind.conf" so I tried uncommenting the line in that file which tells systemd to handle the suspend button, but no luck, not even after rebooting to hopefully get it to source that file.

Here is my ACPI folder's tree...

.
./events
./events/anything
./events/lm_battery
./events/lm_lid
./events/lm_ac_adapter
./handler.sh
./actions
./actions/lm_battery.sh
./actions/lm_lid.sh
./actions/lm_ac_adapter.sh


It has everything it should have, i think. The handler script has a "case" for suspend button.

Running "sudo pm-suspend" in a terminal suspends it, as does going into the XFCE shutdown menu and hitting suspend.

I can't think of anything else to try. Also, I did look around for other posts, but wasn't able to find anything. If I missed something, I appologize for the double post.

Thanks,
--Scott

EDIT: I swear I meant to put this in "laptop issues." This is embarrassing.

Last edited by scott_fakename (2013-01-12 21:41:45)

Offline

#2 2012-10-17 21:59:47

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: [SOLVED] Suspend button no longer works after update

Moving to Laptop Issues.

@scott_fakename: Please always use the "Report" button to notify the moderators about errors like this.


To know or not to know ...
... the questions remain forever.

Offline

#3 2012-10-20 06:14:32

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Suspend button no longer works after update

You know, it would probably be beneficial if, when asking for help with acpid, you post the relevent script that controls the function.  In this case that is the handler.sh script, apparently.  It is very hard to debug without the necessary information.

Offline

#4 2012-10-21 03:10:40

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: [SOLVED] Suspend button no longer works after update

Post logind.conf at the same time if you are using systemd. I thought that systemd handled the suspend button by default? Curious about what exactly you've uncommented. (I'm guessing the default.)

Also, are you using a DE? If so, which?

Last edited by cfr (2012-10-21 03:11:13)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2012-11-19 21:48:46

scott_fakename
Member
Registered: 2012-08-15
Posts: 92

Re: [SOLVED] Suspend button no longer works after update

Sorry for not responding more punctually. handler.sh is as follows (the only modifications to it would have been things done by the system itself, as i haven't touched it)

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

case "$1" in
    button/power)
        case "$2" in
            PBTN|PWRF)
                logger 'PowerButton pressed'
                ;;
            *)
                logger "ACPI action undefined: $2"
                ;;
        esac
        ;;
    button/sleep)
        case "$2" in
            SLPB|SBTN)
                logger 'SleepButton pressed'
                ;;
            *)
                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'
                ;;
            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:

Also, here is logind.conf, which is back to its original state:

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# See logind.conf(5) for details

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#Controllers=
#ResetControllers=cpu
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes

The line that i uncommented (to no effect) was "HandleSuspendKey=suspend".

I sort of have a workaround, inasmuch as I use XFCE and XFCE can handle the suspend key just fine, but the catch is that I have to have the DM up in order for it to do so, so it's not really a "solution" per se. Anyway. I don't know what else to try. The only other thing I could think of was to look in to laptop mode utils to see if others had had problems with it, but googling around yeilded nothing pertinent to this particular issue.

Offline

#6 2012-11-19 22:56:30

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: [SOLVED] Suspend button no longer works after update

So acpid's handler.sh script is just logging events, right? It isn't meant to be handling any of them? (That is, it isn't meant to e.g. suspend the machine when the suspend button is pressed.)

The man page for logind.conf confuses me. On the one hand, it fails to list "suspend" as a valid value for the "Handle..." keys. On the other, it claims it is the default for HandleLidSwitch and HandleSuspendKey.

If XFCE is not running, does the suspend key work?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#7 2012-11-20 00:16:02

scott_fakename
Member
Registered: 2012-08-15
Posts: 92

Re: [SOLVED] Suspend button no longer works after update

If XFCE is not in the active window, the suspend button doesn't work. If XFCE is running, but I have tty1 up (not tty7 which is the one my x server runs on), then it is ignored.

Offline

#8 2012-11-20 00:40:02

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: [SOLVED] Suspend button no longer works after update

But what if it is not running?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#9 2012-11-20 15:40:21

scott_fakename
Member
Registered: 2012-08-15
Posts: 92

Re: [SOLVED] Suspend button no longer works after update

If I boot up in non-graphical mode, then the button is just just ignored.

Offline

#10 2013-01-12 21:39:46

scott_fakename
Member
Registered: 2012-08-15
Posts: 92

Re: [SOLVED] Suspend button no longer works after update

So there were a couple of problems. First was that acpid wasn't running. So a simple "sudo systemctl enable acpid" and then "sudo systemctl start acpid".

Then I just had to put the desired commands in /etc/acpi/handler.sh. I don't know why they were working before and not now, but it was a simple matter of adding entries. For example, making "hibernate" work, just add a "case" like so:

    button/suspend)
        case "$2" in
            SUSP)
                logger 'Hibernate pressed'
                /usr/sbin/pm-hibernate
                ;;
            *)
                logger "ACPI action undefined: $2"
                ;;
        esac
        ;;

and to make any other button like that work, just run acpi_listen, hit the button, add the first word as an argument to case in the handler.sh script and do another "case" to test the second word. Then you just have to put in the command that you want it to run.

Easy once I knew where to look.

After that it's just a matter of telling XFCE (or whatever GDM you're using) not to handle the suspend keys and so forth, to prevent double-hibernate and double-suspend.

Hope someone finds this useful.

--Scott

Offline

Board footer

Powered by FluxBB