After long-standing problems with the sleep settings for this iMac (iMac17,1), I don’t let it go to sleep at all. When I did let it sleep, no matter what I set the disk sleep option to, it would sleep the hard disk in its Fusion Drive. Knowing that waking a hard disk up tends to wear it out, I didn’t want that.
So for many months, it has been set to put the display to sleep after 3 hours, to prevent the computer from sleeping, and not to put its hard disk to sleep. When I come down in the morning and wake its display up, I don’t hear the hard disk running back up to speed, and checking its logs shows that Time Machine has run dutifully throughout the night.
When I got up on Monday morning and woke my iMac up, I was surprised to hear its hard disk run up from sleep. Shortly afterwards, Time Machine started making quite a large backup. So I checked my logs, using LogLogger, only to discover that this was the first backup that it had run since 23:22 the previous night.
Yes, despite those settings in Energy Saver being unchanged, my iMac had gone to sleep, its hard disk with it.
There was no harm done apart from losing another few hours from the life of its hard disk, but I’m totally baffled that macOS seems to have defied the Energy Saver settings. When I went to check those, in /Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist, I was surprised to see that file gone, leaving a shadow file in its place, with ~previous appended to its extension.
As far as I can tell, the update to macOS Sierra 10.12.2 moved the location of the Energy Saver settings file from there back to /Library/Preferences/com.apple.PowerManagement.plist Having found that, my settings definitely contain the entries
<key>Disk Sleep Timer</key>
<key>System Sleep Timer</key>
which should prevent both system and hard disk sleep. Even in the settings for use when running off my UPS, disk sleep is fixed at 0, which should prevent hard disk sleep.
So, what happened in the logs?
At 06:39, macOS suddenly decided that it was going to sleep:
06:39:28.13 sharingd: [com.apple.sharing.Daemon] Device can sleep
06:39:34.30 securityd: [com.apple.securityd.powerwatch] can system sleep
06:39:41.90 LaterAgent: (StoreFoundation) [com.apple.commerce.CKLegacy] LAPowerEventObserver: System is considering sleep
06:39:34.66 securityd: [com.apple.securityd.powerwatch] system will sleep
06:39:34.66 securityd: [com.apple.securityd.SS] 0x7fff51908b30 will sleep
06:39:28.51 sharingd: [com.apple.sharing.Daemon] Device will sleep
06:39:48.62 kernel: PMRD: System Sleep
06:39:48.64 kernel: IOCPUSleepKernel
06:39:48.64 kernel: IOPlatformSleepAction -> AppleSMBusControllerICH
06:39:48.64 kernel: IOPlatformSleepAction -> AppleThunderboltHAL
06:39:49.17 kernel: (AppleThunderboltNHI) AppleThunderboltGenericHAL::lateSleep - complete - took 532 milliseconds
06:39:49.17 kernel: (AppleACPIPlatform) ACPI SLEEP
When I rudely woke it up after this catnap:
07:21:58.85 kernel: (AppleSMC) Previous sleep cause: 5
07:21:58.96 kernel: PMRD: prevent idle sleep list: IODisplayWrangler+ (1)
07:21:58.96 kernel: prevent idle sleep list: IODisplayWrangler+ (1)
07:21:59.70 kernel: (PromiseSTEX) STEX : setPowerState : 2, (0 = sleep , 1 = pause, 2 = wake)
Apparently code 5 for a previous sleep cause means a user-initiated or -controlled event, rather than power-related. At no time had my Mac restarted (it has now run 23 days without shutdown or restarting).
So there is a ghost in this machine, and it seems to get tired on occasion. Or can you think of a better explanation?