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
-
3I'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.– squillmanJun 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– honzasJun 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).– StefanSep 21, 2014 at 15:37
Add a comment
|
2 Answers
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.
-
5
-
3Yeah, 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" Jul 6, 2017 at 17:21 -
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 showsWake-up Type: APM Timer
.– ZoltanJan 17, 2021 at 9:53
This sorta explains it at the hardware level. What do you see when you dmesg | grep -i 'acpi'
?
-
2Yes, 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.– honzasJun 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.– songei2fJun 14, 2011 at 17:14
-
1Interesting. 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.– songei2fJun 14, 2011 at 20:25
-
1This 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.– songei2fJun 14, 2011 at 20:39
-
1The link is dead. Any chance you can incorporate what it said in the answer itself?– fifaltraMar 26, 2019 at 17:40