20

Is it possible to get the reason of system wake-up (Wake-on-LAN, Power button, wake from USB) on Linux? I'm using Ubuntu, kernel Linux homeless 2.6.37-12-generic #26~lucid1-Ubuntu SMP Wed Jan 5 21:52:06 UTC 2011 i686 GNU/Linux

3
  • 3
    I'm not a linux expert, but if this is possible it may be distribution specific so you might want to include which distribution you're working with. This is usually a good idea with any question you ask of any OS.
    – squillman
    Commented Jun 14, 2011 at 15:18
  • I think it is not very distro-specific (maybe it is stored somewhere in /sys or /proc), but I am using: Linux homeless 2.6.37-12-generic #26~lucid1-Ubuntu SMP Wed Jan 5 21:52:06 UTC 2011 i686 GNU/Linux
    – honzas
    Commented Jun 14, 2011 at 15:59
  • I'd really like to know as well! In my case I'd like to know if my machine woke up because of the RTC alarm (in which case it should go back to sleep after running a little script) or because I pressed a keyboard key (in which case it shouldn't go back to sleep until I say so).
    – Stefan
    Commented Sep 21, 2014 at 15:37

2 Answers 2

6

Depending on your hardware, you can find this using dmidecode:

$ sudo dmidecode |grep Wake-up
    Wake-up Type: Power Switch

There is lots of other useful hardware info from dmidecode, like the make/model/serial number of your motherboard/DIMMs/CPUs

In ubuntu it comes with the package dmidecode, should be available even in Lucid.

3
  • 6
    As far as I can tell, that always says "Power Switch".
    – Sec
    Commented Feb 12, 2015 at 8:42
  • 3
    Yeah, that just gives hardware info rather than activity logging. But on this note - how can you tell if a motherboard supports wake on lan via dmidecode? All my machines say "Power Switch" Commented Jul 6, 2017 at 17:21
  • 1
    This works for me. If I wake my computer up with the keyboard, it shows Wake-up Type: PCI PME#. If the computer was awakened by the RTC clock, it shows Wake-up Type: APM Timer.
    – Zoltan
    Commented Jan 17, 2021 at 9:53
1

This sorta explains it at the hardware level. What do you see when you dmesg | grep -i 'acpi'?

8
  • 2
    Yes, I know abou /proc/acpi/wakeup and I'm using it on another machine and it selects which devices are allowed to wakeup the system. But after the wakeup I'm unable to say which of these devices causes the wakeup.
    – honzas
    Commented Jun 14, 2011 at 16:02
  • Hence I ask: does grepping the kernel log not tell you what wakes up the device via ACPI? I tried grepping it on a desktop, so I obviously did not find anything fun there.
    – songei2f
    Commented Jun 14, 2011 at 17:14
  • 1
    Interesting. When Googling about it, a lot of people complained about noisy debug logs. It might be they subsequently changed the logging level to be quieter by default, and you need to up the noise if you want to see the old stuff.
    – songei2f
    Commented Jun 14, 2011 at 20:25
  • 1
    This might be even more useful, a list of debug params you can pass that specify the specific kinds of ACPI info you want to see.
    – songei2f
    Commented Jun 14, 2011 at 20:39
  • 2
    The link is dead. Any chance you can incorporate what it said in the answer itself?
    – fifaltra
    Commented Mar 26, 2019 at 17:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .