Computer shutting down (dirty) randomly

Everyday when I come back to my system it will be shutoff no matter what I do, if I log out, it'll be shutdown, if I restart it will be shutdown. A grep through the log files shows me this:

2018-03-29 16:06:29.964161-0500 0x4a8      Default     0x0                  0      kernel: (AppleSMC) Previous shutdown cause: 3
2018-03-29 18:30:34.297536-0500 0x435      Default     0x0                  0      kernel: (AppleSMC) Previous shutdown cause: 3
2018-03-30 09:42:33.355573-0500 0x420      Default     0x0                  0      kernel: (AppleSMC) Previous shutdown cause: 3

The 3 means hard reboot (or so I've gathered) but I'm not rebooting my system. Is there a way for me to tell what is causing my reboots or if there is an application that is crashing that could be causing this?

EDIT:

I've figured out that the 3 is a dirty forced shutdown, so this leaves the question, how can I determine what is causing the issue?


I actually believe I've found a fix for this.

I started greping through all the log files from when this issue started happening looking for a pattern. As it turns out the pattern is that the GoogleSoftwareUpdateDaemon runs everytime right before the crash happens:

Mar 30 13:33:55 <COMP-NAME> GoogleSoftwareUpdateDaemon[19078]: 2018-03-30 13:33:55.245 GoogleSoftwareUpdateDaemon[19078/0x7fff77030000] [lvl=2] -[KeystoneDaemon main] GoogleSoftwareUpdateDaemon inactive, shutdown.
Mar 30 13:34:00 localhost kernel[0]: Previous shutdown cause: 3

So doing some research, this is a updater that is secretly installed by Google (it is nowhere in their terms of service, nor is there a warning for it) what this does is update your Google applications every 5 hours. In order to disable this you can do the following:

defaults write com.google.Keystone.Agent checkInterval 0

What that command will do is set the interval for checking to 0. This is probably not recommended since security updates are important, so you can also set the interval for once a week:

defaults write com.google.Keystone.Agent checkInterval 604800

Now apparently this updater takes up very minuscule amounts of resources, but what they don't tell you is that it depends on how much Google software is on your system, it runs all the updates at one time. For example, if you have Google Chrome, Google Drive, and Google Hangouts installed, it will attempt to run updates for all of those pieces of software at once.

So what I did is the first option, set it to 0 and watched the computer for over an hour. Nothing happened, restarted and it boot right up, watched for another hour and it didn't crash or turn off. Going to assume this was the problem and move on with my life.


A shutdown cause of "3" is a hard shutdown - when you press and hold the power button.

More than likely there's a contaminant causing a short that is forcing the button to engage (electrically speaking) thus making your Mac "see" an ACPI shutdown.

Try cleaning it but you may have to have it replaced.