'Recent' changes to the website
[pwan.org.git] / content / hints / fixing-hibernation.rst
1 The case of the late night system boots
2 #######################################
3
4 :date: 2013-08-09
5 :tags: hints,ubuntu,hibernation
6 :category: hints
7 :author: Jude N
8
9 A few weeks back, at around 3:00AM I was woken up by the sounds of a computer booting. It turned out to be an old Ubuntu desktop in the study. Since it was storming at the time, I figured it due to a power outage so I shut down the machine and went back to bed.
10
11 A couple nights later the same thing happened. This time I made sure the BIOS on the machine was set to `restore the machine to its previous state after an outage`_ instead of turning it on. It turned out it was already set to restore the previous state. Odd, but it was 3:00AM so back to bed I went.
12
13 The third time it woke me up was soon during the time `Thinkhost/Dreamhost dropkicked the old site in the gonads`_, and I start freaking out a little - I wasn't
14 getting email, my corny vanity site had disappeared and I had a machine turning itself on in the middle of the night. It was coming out of hibernation when it started,
15 so when I noticed it, I was already logged into the console and my 3:00AM self didn't notice any weird activity on the machine. I poked around on the BIOS again to make
16 sure the `Wake-on-LAN`_ options were not set and powered down the computer. Still, I started pulling Ethernet cables out before going to bed until I had a chance to really figure out
17 what was going on.
18
19 Then over the weekend I had started the machine up and then started some Laundry [*]_. When I eventually got back to study, the machine it was still one. I'd been gone long enough that it
20 should have gone into hibernation by then. I did a 'sudo /usr/sbin/pm-hibernate' manually and it went through its normal hibernate routine, but after it powered down,
21 it immediately booted back up again !
22
23 Then it all made sense - the machine had been trying to hibernate and rebooting, then waiting some number of minutes with no keyboard activity and repeating the cycle.
24 If I was sleeping lightly enough at the time , the beeps during the restart would wake me up, otherwise I was sleeping through all the restarts. Eventually someone in the
25 house would notice the machine was on and shut it down gracefully. I have no clue how long hibernate had been failing like this. Weeks at least.
26
27 But onto the solution. I didn't find much on the Internet about the problem (hence this post), but the combination of the `basic-pm-debugging.txt`_ and the
28 `pm-hibernate man page`_ led me to try adding an '/etc/pm/config.d/hibernate file with the contents::
29
30 HIBERNATE_MODE=shutdown
31
32 With that in place, pm-hibernate went back to working like it used to, and I haven't been woken up by late night restarts since.
33
34 .. [*] For purposes of this blog, 'Laundry' is any non-computer indoor activity and 'Going for a Walk' is any non-computer outdoor activity.
35 .. _restore the machine to its previous state after an outage: http://superuser.com/questions/368891/desktop-bios-after-power-failure-setting-behavior
36 .. _Thinkhost/Dreamhost dropkicked the old site in the gonads: https://pwan.org/blog/first-post.html
37 .. _Wake-on-LAN: https://en.wikipedia.org/wiki/Wake-on-LAN#Unauthorized_access
38 .. _basic-pm-debugging.txt: http://www.mjmwired.net/kernel/Documentation/power/basic-pm-debugging.txt
39 .. _pm-hibernate man page: http://linux.die.net/man/8/pm-hibernate