MacBook Pro (Retina, 13-inch, Mid 2014) and
$ pmset -g System-wide power settings: Currently in use: standbydelay 10800 standby 1 womp 1 halfdim 1 hibernatefile /var/vm/sleepimage powernap 0 gpuswitch 2 networkoversleep 0 disksleep 10 sleep 1 autopoweroffdelay 28800 hibernatemode 3 autopoweroff 1 ttyskeepawake 1 displaysleep 10 acwake 0 lidwake 0
I was testing what the best practice is to make sure my macbook is asleep before putting it to my backbag. So I wrote a simple script like this:
$ cat sleep-detector.sh while true; do echo `date` " -------- not sleep yet" tput bel sleep 1s done
I ran this script for all my following tests from terminal.app.
When I close the lid directly, the bell sound will be off immediately (even if the script will continue to run for about 20s). This is expected.
I thought it was much safer to put the system to sleep manually by → Sleep , but I was wrong.
If I use → Sleep, and wait for 20 seconds and then close the lid, everything is expected as before.
But If I use → Sleep and close the lid immediately, the weird thing happened. At the beginning, when I click → Sleep, the bell is off immediately, but when I close the lid very quickly, the bell is on. And it's on for a long time. (I don't bother wait for a long time. my test is actually 3 minutes).
This surprises me a lot. How come closing a lid cause the system back online and awake?! Is this a bug?