[solved] ACPI - Power Button

Discussion in 'General Linux' started by Matesax, Mar 15, 2014.

  1. Matesax

    Matesax Member

    Messages:
    56
    Likes Received:
    11
    Trophy Points:
    8
    I have:
    ACPI
    ACPID
    ACPI-Support
    packages and I don't have any Desktop - power manager,... I want to have hibernation in power button event. powerbtn is set to hibernate, but PC is shutdowning - why?
    Thank you!

    Last edited: Mar 17, 2014
    DevynCJohnson likes this.
  2. labrat

    labrat Active Member

    Messages:
    104
    Likes Received:
    43
    Trophy Points:
    28
    There are two types of "hibernation" - suspend to disk and suspend to RAM, which is it?

    Also with that little info, there's not much to go on.

    Distribution?

    Kernel version?

    Hardware?
  3. Matesax

    Matesax Member

    Messages:
    56
    Likes Received:
    11
    Trophy Points:
    8
    Hibernation is hibernation - not suspend... Suspend using RAM, hibernation using SWAP. It is irrelevant... Problem is in ACPI action - no in pm-utils... pm-hibernate works! I builded Linux from scratch on AMD64 - but latest 32bit version.
    Last edited: Mar 15, 2014
    DevynCJohnson likes this.
  4. Matesax

    Matesax Member

    Messages:
    56
    Likes Received:
    11
    Trophy Points:
    8
    I'm getting:

    No support for device type: power_supply

    It can be the problem?
  5. labrat

    labrat Active Member

    Messages:
    104
    Likes Received:
    43
    Trophy Points:
    28
    Yes... but I didn't know that you knew that... just like I can't afford to hire a psychic to work out what hardware you have - money is tight this week, so perhaps next week...

    Plus if you've already got all the answers and know what's relevant and what's irrelevant and managed to build an LFS system, you probably don't need anyone's help... you built your kernel, you know what you put into it/left out of it, you figure it out or try STFW...
  6. Matesax

    Matesax Member

    Messages:
    56
    Likes Received:
    11
    Trophy Points:
    8
    Yes, I used to build OS from sources too many times. But always was enough to install ACPID and it was possible to set ACPI events handlers... Now, I install ACPID and power button event is not called. Therefore it must be problem between kernel and ACPI(D)...
  7. DevynCJohnson

    DevynCJohnson Well-Known Member Staff Member Staff Writer

    Messages:
    1,336
    Likes Received:
    1,074
    Trophy Points:
    113
    Does this help at all - http://www.cyberciti.biz/faq/linux-command-to-suspend-hibernate-laptop-netbook-pc/

    Hibernate - disk, hardware powered down
    Sleep/Suspend - RAM (there are some minor differences between sleep and suspend), some power still used

    Trick to remembering -
    hibernation is more deep (try waking a hibernated animal) while sleep/napping is light (drugs excluded).


    You could also manipulate the rc scripts. Also, the power button's actions can be tweaked in the power settings.
  8. Matesax

    Matesax Member

    Messages:
    56
    Likes Received:
    11
    Trophy Points:
    8
    I want run pm-hibernate on ACPI event - pm-hibernate works! Only ACPI event handler powerbtn no...

    Why do you described me hibernation and suspend? I know it - I'm Assembler Language & C/C++ programmer... :D

    Mentioned error is not problem - ACPI not report any interesting messages... I tried restart ACPI etc. ACPI running... How can I determine where is the problem?

    Debug:
    Code:
    acpid: can't open /proc/acpi/event: Device or resource busy (16)
    input layer /dev/input/event0 (Power Button) opened successfully, fd 4
    input layer /dev/input/event1 (Power Button) opened successfully, fd 5
    input layer /dev/input/event2 (AT Translated Set 2 keyboard) opened successfully, fd 6
    input layer /dev/input/event4 (HDA NVidia Front Headphone) opened successfully, fd 7
    input layer /dev/input/event5 (HDA NVidia Line Out) opened successfully, fd 8
    input layer /dev/input/event6 (HDA NVidia Line) opened successfully, fd 9
    input layer /dev/input/event7 (HDA NVidia Front Mic) opened successfully, fd 10
    input layer /dev/input/event8 (HDA NVidia Rear Mic) opened successfully, fd 11
    inotify fd: 12
    inotify wd: 1
    netlink opened successfully
    acpid: starting up with netlink and the input layer
    parsing conf file /etc/acpi/events/powerbtn
    acpid: 1 rule loaded
    acpid: waiting for events: event logging is off
    
    Last edited: Mar 17, 2014
  9. DevynCJohnson

    DevynCJohnson Well-Known Member Staff Member Staff Writer

    Messages:
    1,336
    Likes Received:
    1,074
    Trophy Points:
    113
    The definitions were not for you.;)

    Unfortunately, I do not know enough about ACPI to figure out the error. Are there any special ACPI extensions that you can install that will give you better ACPI features or fix your problem.

    What is your native language? Many users on this site use Google Translate to translate foreign languages, so if you feel you can ask better in your language, we can translate it thanks to Google's free service.
  10. Matesax

    Matesax Member

    Messages:
    56
    Likes Received:
    11
    Trophy Points:
    8
    Oh no - so easy!!! :D So fast... (systemd)

    /etc/systemd/logind.conf

    Without pm-utils!

    OK, but I have following problem - GRUB menu is showing after wake up from hibernation - how can I disable it at all?
  11. DevynCJohnson

    DevynCJohnson Well-Known Member Staff Member Staff Writer

    Messages:
    1,336
    Likes Received:
    1,074
    Trophy Points:
    113
    You could set up GRUB to boot-up the desired OS by default automatically after a set amount of time.
  12. Matesax

    Matesax Member

    Messages:
    56
    Likes Received:
    11
    Trophy Points:
    8
    I'm not stupid... :D GRUB menu is not showing after normal boot. (I have only one OS in my computer - and GRUB menu is disabled) But after wake up from hibernation...
    DevynCJohnson likes this.
  13. DevynCJohnson

    DevynCJohnson Well-Known Member Staff Member Staff Writer

    Messages:
    1,336
    Likes Received:
    1,074
    Trophy Points:
    113
    That is odd. I never heard of something like that happening.:eek:
  14. Matesax

    Matesax Member

    Messages:
    56
    Likes Received:
    11
    Trophy Points:
    8
    https://forums.mageia.org/en/viewtopic.php?f=7&t=6052

    https://features.opensuse.org/308705?contenttype=text/print

    http://hamberg.no/erlend/posts/2010-10-01-showing-grub-menu-after-hibernating-in-opensuse.html

    http://askubuntu.com/questions/178091/how-to-disable-grubs-menu-from-showing-up-after-failed-boot

    The problem persists despite all efforts... It is big problem for me because timeout for default selected menu item is missing - only in GRUB menu displayed after wake up. And I used not to care. Just turn on the computer and do not care about GRUB...
  15. MikeyD

    MikeyD Active Member

    Messages:
    232
    Likes Received:
    112
    Trophy Points:
    43
    Odd that most people in those links have the opposite problem (trying to wake up to grub to choose the OS for muti-boot machines.)

    This post on the openSUSE link is probably a step in the right direction...
    Although most of the distros on those links don't use systemd by default (probably still initrd) so it could be an issue with how systemd "talks" to grub.

    Since you aren't using pm-utils, grub probably doesn't make the /usr/lib/pm-utils/sleep.d/99Zgrub call after waking up. I'd look into alternatives for systemd or try to find a way to "hack" grub into calling 99Zgrub
  16. Matesax

    Matesax Member

    Messages:
    56
    Likes Received:
    11
    Trophy Points:
    8
    Can't I simply disable the GRUB menu? I want to display it only after pressing shift key (modifier key).
  17. MikeyD

    MikeyD Active Member

    Messages:
    232
    Likes Received:
    112
    Trophy Points:
    43
    That may be an option. I'm by no means a GRUB expert.

    The first answer of this post mentions setting GRUB_HIDDEN_TIMEOUT_QUIET=true

    http://askubuntu.com/questions/1110...grub-menu-showing-up-in-the-beginning-of-boot

    I assume you may have this set already if you don't get GRUB at boot. Another option couldbe to define a custom systemd hook for suspend/hibernate...

    https://wiki.archlinux.org/index.php/Power_management#Sleep_hooks


    Another option, you could disable GRUB altogether...

    http://www.ondatechnology.org/wiki/index.php?title=Booting_the_Linux_Kernel_without_a_bootloader

    Apparently only for kernel versions 3.3+ and on EFI mobos. I've never tried it though.
  18. Matesax

    Matesax Member

    Messages:
    56
    Likes Received:
    11
    Trophy Points:
    8
    I have set GRUB_HIDDEN_TIMEOUT_QUIET boolean to true... But thank you for those links! I unconditionally try it when I'll at home...
  19. Matesax

    Matesax Member

    Messages:
    56
    Likes Received:
    11
    Trophy Points:
    8
    OK - sorry - "GRUB_DEFAULT=saved" need only reboot - now it working!
    Last edited: Mar 18, 2014

Share This Page