Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
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 Jun 14 '11 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 Jun 14 '11 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 Sep 21 '14 at 15:37

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.

share|improve this answer
As far as I can tell, that always says "Power Switch". – Sec Feb 12 '15 at 8:42

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

share|improve this answer
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 Jun 14 '11 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 Jun 14 '11 at 17:14
This a pretty old message about a kernel bug, it specifically shows while debugging ACPI issues in 2.6.17 and beyond that it will list the device by PCI bus designation (or whatever the hell that is), and say wakeup, no? – songei2f Jun 14 '11 at 17:52
I have tried it but there is no difference between dmesg after WOL and power button. – honzas Jun 14 '11 at 18:38
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 Jun 14 '11 at 20:25

You must log in to answer this question.

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