I have MacBook Pro (Retina, 13-inch, Mid 2014) and OS: 10.13.6.

My current pmset -g:

$ 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;
    echo `date` " -------- not sleep yet"
    tput bel
    sleep 1s

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?

  • Please don't post the same question twice. – nohillside Nov 28 at 7:57
  • @nohillside are there anything wrong with you? These two questions have nothing the same. Jesus!. I can't believe it. Really. Wha's wrong with you? How come you as an adult (probably) think they are the same question. – sgon00 Nov 28 at 8:19
  • No need to be rude. The question here is basically just unclear, so I assumed you've posted an updated version and forgot to remove this one. – nohillside Nov 28 at 8:28
  • @nohillside First, I didn't say any rude words to you. Second, you marked my new question as a duplicated one is rude to me. Third, the question is very clear to me, but maybe not to you. The last question is about the opening lid action. And this question is about closing lid action. They are nothing in common. This question is a weird situation that the script I wrote becomes awake and running after closing the lid. – sgon00 Nov 28 at 8:32
  • @nohillside Sorry, I just read Code of Conduct. I should say “Sorry. I don’t think this is a duplicate. My question is about cement board, while the question you linked is about drywall.”. Sorry that I was very angry when my question was marked as duplicated, especially, when I spent two days on macbook sleep-wake issues which drive me crazy. Very sorry. – sgon00 Nov 28 at 10:31

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.