iMac abruptly switches off at random
For the past month or so, I’ve been having a problem with my late-2012, 27-inch iMac that I can’t quite put my finger on. In short, the computer switches off abruptly at seemingly random times — it doesn’t shut things down, logs out, turns the power off, etc. but just goes from working normally to off as if someone pulled the power cord out of it. Sometimes up to a week or so goes by without this happening, and at other times it does it several times in a day; it happens when the computer is being used but also when it’s asleep.
Turning it back on requires me to unplug the power cord, wait a bit, and then put it back in before the computer will respond to the power button.
Looking through the system logs doesn’t show anything useful. Here’s an extract:
15-09-15 19:41:50,892 com.apple.xpc.launchd[1]: (com.apple.photostream-agent[2562]) LaunchServices returned a bundle URL that does not match with the LoginItem's known association.
15-09-15 19:41:50,893 com.apple.xpc.launchd[1]: (com.apple.photostream-agent) Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
15-09-15 19:44:06,000 bootlog[0]: BOOT_TIME 1442339046 0
15-09-15 19:44:55,000 syslogd[42]: Configuration Notice:
ASL Module "com.apple.AccountPolicyHelper" claims selected messages.
Those messages may not appear in standard system log files or in the ASL database.
15-09-15 19:44:55,000 syslogd[42]: Configuration Notice:
ASL Module "com.apple.authd" sharing output destination "/var/log/asl" with ASL Module "com.apple.asl".
Output parameters from ASL Module "com.apple.asl" override any specified in ASL Module "com.apple.authd".
When the computer turned off at 19:41:51 hours or so (that is, earlier tonight) I was using a web site in Safari, and as the log shows, I got it powered back up a bit over two minutes later. I’ve checked the logs almost every time after this has happened, and as far as I can tell there are never any messages about things going wrong that would cause the computer to switch off. I can’t trace the problem to something I’m doing or some program that’s running, because it hardly ever happens under the exact same circumstances.
I’ve pretty much ruled out that this happens because the computer doesn’t get any electricity: there’s a stereo and two external hard drives plugged into the same power strip, and these all keep running fine. I’ve also changed the power strip for a new one (and I mean a new one) without any effect. What’s more, I went into the system prefs and set it that the computer automatically turns on after power loss, but it doesn’t do that if it switches itself off. On the other hand, if I unplug the power cord, wait for about a minute and put it back in, it immediately boots up. If I plug it back in too soon though, the computer refuses to start, whether automatically or after I press the power button.
I ran the hardware test, did the extensive one, and it reported no errors. I’ve also reset the SMC — to be honest, I seem to have no choice but to reset the SMC if I want the machine to start at all after it turns itself off 🙂
All in all, I'm leaning toward the idea that there’s something wrong with the SMC, though. If it was the power supply then I’d think the computer wouldn’t need the power cord disconnected to work again, so it all gives me the impression that the SMC goes wrong somehow, kills the power to the whole machine, and needs a reset before it will work again.
So my questions, basically, are: am I right? If so, what can I do about it? And if not, what else could it be and how can I fix it?
iMac, OS X Yosemite (10.10.5)