Macbook running Ubuntu 18.04 won't go to sleep

6,394

Solution 1

The link from BrainCore's answer above gives these instructions: Occasionally the Macboook Air may wake up immediately after suspend. To fix this:

cat /proc/acpi/wakeup

Check to see that XHC1 and LID0 are enabled. If they are, disabling them will fix the problem. After disabling them, the only way to wake up your computer from suspend is by using the power button.

To disable these settings, create the following service that runs on startup:

sudo vim /etc/systemd/system/suspend-fix.service

Then add the following text and save:

[Unit]
Description=Fix for the suspend issue
[Service]
Type=oneshot 
ExecStart=/bin/sh -c "echo XHC1 > /proc/acpi/wakeup && echo LID0 > /proc/acpi/wakeup"
[Install]
WantedBy=multi-user.target

And then run the following:

systemctl enable suspend-fix.service
systemctl start suspend-fix.service

Disabling only XHC1 is not recommended if you have this bug, since it may result in glitchy behavior.

Solution 2

I was searching for a solution, and stumbled on your question, and then this answer: https://wiki.archlinux.org/index.php/Mac#Wake_Up_After_Suspend

Works for me. You'll need to use the power button to unsuspend.

Share:
6,394
ToniAz
Author by

ToniAz

Updated on September 18, 2022

Comments

  • ToniAz
    ToniAz over 1 year

    I have a Macbook pro running Ubuntu 18.04 with GNOME 3. I use my laptop in 2 setups:

    1. Closed lid with a monitor
    2. Open lid with no monitor

    I've been noticing that when I pull my laptop out of my bag, it's very hot and the Apple logo is lit. Here is how I usually suspend my laptop.

    Setup 1:

    1. I click the battery/audio/wifi icon
    2. I press Alt so that the Power icon turns into a Pause icon
    3. I hit the Pause icon
    4. I watch the Apple logo on the back of my laptop turn off, then turn on again, then turn off.
    5. I unplug and put away my laptop.

    NOTE: If I do not unplug my laptop from the monitor, the monitor goes black briefly, then I see the login screen!

    Setup 2:

    1. I click the battery/audio/wifi icon
    2. I press Alt so that the Power icon turns into a Pause icon
    3. I hit the Pause icon
    4. I close the lid
    5. I watch the Apple logo on the back of my laptop turn off, then turn on again, then turn off I put away my laptop
    6. List item

    Why won't my Macbook pro go to sleep? I do not want to shut down every time I go out.

    • dazza5000
      dazza5000 over 5 years
      I have this same issue. Did you determine a fix?
    • ToniAz
      ToniAz over 5 years
      @dazza5000 nah, only more problems.
    • dazza5000
      dazza5000 over 5 years
      I upgraded to 18.10 and have more reliability around going to sleep and resuming.
  • Melebius
    Melebius about 5 years
    Welcome to Ask Ubuntu! Please do not post answers depending on external links. Put the relevant part into your answer (or post the link as a comment to the question if you have enough reputation). See How to Answer for details.
  • ToniAz
    ToniAz about 5 years
    Thank you very much! But this ship has sailed, and I subbed out Ubuntu for Mojave.