Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Zmmyt

macrumors 68000
Original poster
Jan 6, 2005
1,723
774
hi everyone.

for a few weeks now our mac has stopped going to sleep...any idea why? i searched all over the web but no luck so far.

cheers!
 

Attachments

  • Screenshot 2019-08-26 at 22.59.44.png
    Screenshot 2019-08-26 at 22.59.44.png
    101.5 KB · Views: 1,428

Honza1

macrumors 6502a
Nov 30, 2013
933
433
US
check what pmset -g is saying (open Terminal and run this command there). Description of what the pmset output is is here (https://en.wikipedia.org/wiki/Pmset) or run in Terminal "man pmset" to open manual. May be somehow something disabled sleep altogether. You can change the power management parameters in lot more details using this command. In that case you need to run sudo pmset -and flags you want to set...

There are software tools to prevent sleep - and caffeinate command - again run in Terminal - is even built in the system itself. Are you sure you are not accidentally running something like that?

There are also weird work arounds which enable users to prevent sleep altogether. May be someone has applied those? If that is a case, reinstall of the system "in place" may be easiest and non-destructive way to fixing it.

Note: each Mac has different power management settings, so to get help in the future you may need to provide details on your hardware and software version.
 

Zmmyt

macrumors 68000
Original poster
Jan 6, 2005
1,723
774
check what pmset -g is saying (open Terminal and run this command there). Description of what the pmset output is is here (https://en.wikipedia.org/wiki/Pmset) or run in Terminal "man pmset" to open manual. May be somehow something disabled sleep altogether. You can change the power management parameters in lot more details using this command. In that case you need to run sudo pmset -and flags you want to set...

There are software tools to prevent sleep - and caffeinate command - again run in Terminal - is even built in the system itself. Are you sure you are not accidentally running something like that?

There are also weird work arounds which enable users to prevent sleep altogether. May be someone has applied those? If that is a case, reinstall of the system "in place" may be easiest and non-destructive way to fixing it.

Note: each Mac has different power management settings, so to get help in the future you may need to provide details on your hardware and software version.

I have a couple of apps running that can prevent the mac from going to sleep, but they never caused any issues (OneSwitch and Caffeinate). The problem persists when I start the mac in safe mode too.

2018 MacBook Air

thanks!
 

Attachments

  • Screenshot 2019-08-27 at 10.55.02.png
    Screenshot 2019-08-27 at 10.55.02.png
    91.2 KB · Views: 742

Honza1

macrumors 6502a
Nov 30, 2013
933
433
US
I have a couple of apps running that can prevent the mac from going to sleep, but they never caused any issues (OneSwitch and Caffeinate). The problem persists when I start the mac in safe mode too.

2018 MacBook Air

thanks!

Just checking the simple stuff: In the System preferences, Energy Saver, did you try to push the "Restore defaults" button?

That image shows, that sleep is disabled systemwide. That button restores default settings using pmset command and if any settings were accidentally changed, it should fix the problem.
I wonder if any of those applications which prevent sleep has some option which you choose accidentally and it did exactly this - all those GUI programs play with this pmset settings, nothing more.

If that button does not fix it, then I do not know. I would reinstall MacOS over the existing one with full App store installer. That will fix system by reinstall all services and setting them to default values. I have fixed few problems thsi way. It is non destructive and easy to do, but still, make sure you have a good working backup.
 

Zmmyt

macrumors 68000
Original poster
Jan 6, 2005
1,723
774
Just checking the simple stuff: In the System preferences, Energy Saver, did you try to push the "Restore defaults" button?

That image shows, that sleep is disabled systemwide. That button restores default settings using pmset command and if any settings were accidentally changed, it should fix the problem.
I wonder if any of those applications which prevent sleep has some option which you choose accidentally and it did exactly this - all those GUI programs play with this pmset settings, nothing more.

If that button does not fix it, then I do not know. I would reinstall MacOS over the existing one with full App store installer. That will fix system by reinstall all services and setting them to default values. I have fixed few problems thsi way. It is non destructive and easy to do, but still, make sure you have a good working backup.

none of it worked :( since it's still under warranty, will Apple provide me with a hard copy of OS Mojave to do a clean re-install? I don't really fancy spending money on a memory stick which I never use again.
 

Honza1

macrumors 6502a
Nov 30, 2013
933
433
US
none of it worked :( since it's still under warranty, will Apple provide me with a hard copy of OS Mojave to do a clean re-install? I don't really fancy spending money on a memory stick which I never use again.
No, Apple will not hand you stick with installer ;-) They never did, do not make them, and would have a good laugh if you ask. No distribution of hard media for years and years...

But if you want to wipe the system, all you need to do is to boot in recovery mode and wipe/reinstall the system. Alternatively, you can boot to internet recovery and do so also. There are instructions how to do this on the web or just look through this forum.
Note, that it seems, that you should first remove FileValut form the disk or things can go wrong. Also, with the latest machines with added security (various versions of T chip) it is important to find current (best Apple) instructions.
If you have nearby Apple Store, it may be easiest to take it there and ask them to fix the sleep problem - or wipe/reinstall the system for you. They will do it, while you are waiting most likely.
Important: Make backup of everything you have. Test it! May be make second backup... Be paranoid for once.
 

Srini Arumugam

macrumors newbie
Jul 10, 2020
2
11
This helped me!
1. Log in with an account that has admin privileges

2. Open Terminal and run the following command:

1sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.PowerManagement SystemPowerSettings -dict SleepDisabled -bool NO
3. Restart the Mac (this is necessary to apply the change.)

After the restart, you should see that the Sleep command is available again in the Apple menu.
 

ggwwzz11

macrumors newbie
Sep 21, 2015
11
3
This helped me!
1. Log in with an account that has admin privileges

2. Open Terminal and run the following command:

1sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.PowerManagement SystemPowerSettings -dict SleepDisabled -bool NO
3. Restart the Mac (this is necessary to apply the change.)

After the restart, you should see that the Sleep command is available again in the Apple menu.

/Library/Preferences/SystemConfiguration/com.apple.PowerManagement: No such file or directory

Hi Srini, I got this from terminal after your command line and I also went to that finder root path. It seems I don't have such file in the SystemConfiguration folder. Could you offer any solution to help, Thanks!
 

Zmmyt

macrumors 68000
Original poster
Jan 6, 2005
1,723
774
This helped me!
1. Log in with an account that has admin privileges

2. Open Terminal and run the following command:

1sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.PowerManagement SystemPowerSettings -dict SleepDisabled -bool NO
3. Restart the Mac (this is necessary to apply the change.)

After the restart, you should see that the Sleep command is available again in the Apple menu.
i am really sorry...but how on earth can you post something like this and it eliminates the problem straight away. last year i was looking all over the internet for the solution and could find anything!

the problem re-occurred and when i googled it, it took me back to my original post...how weird!?! am i the only one with this problem?

THANKS!
 

oneno2nd

macrumors newbie
Jul 5, 2021
1
0
i am really sorry...but how on earth can you post something like this and it eliminates the problem straight away. last year i was looking all over the internet for the solution and could find anything!

the problem re-occurred and when i googled it, it took me back to my original post...how weird!?! am i the only one with this problem?

THANKS!
Srini Arumugam, Another This Helped! I also want to give you my sincere thanks! I have been troubled with "sleep greyed out" for several weeks and your solution worked immediately. Way to go! ~ oneno2nd
This helped me!
1. Log in with an account that has admin privileges

2. Open Terminal and run the following command:

1sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.PowerManagement SystemPowerSettings -dict SleepDisabled -bool NO
3. Restart the Mac (this is necessary to apply the change.)

After the restart, you should see that the Sleep command is available again in the Apple menu.
 

Love-hate 🍏 relationship

macrumors 68030
Sep 19, 2021
2,949
3,089
This helped me!
1. Log in with an account that has admin privileges

2. Open Terminal and run the following command:

1sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.PowerManagement SystemPowerSettings -dict SleepDisabled -bool NO
3. Restart the Mac (this is necessary to apply the change.)

After the restart, you should see that the Sleep command is available again in the Apple menu.
you ****ing genius,if i could kiss you i would
 

dottdirtt

macrumors newbie
Oct 9, 2018
11
15
This helped me!
1. Log in with an account that has admin privileges

2. Open Terminal and run the following command:

1sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.PowerManagement SystemPowerSettings -dict SleepDisabled -bool NO
3. Restart the Mac (this is necessary to apply the change.)

After the restart, you should see that the Sleep command is available again in the Apple menu.
This works but it keeps happening. On a Macbook Air M1. What's the cause?
 

Honza1

macrumors 6502a
Nov 30, 2013
933
433
US
Some application or script is likely disabling sleep.
There are many web pages dedicated to how to disable sleep on macOS and, for example, if you google nosleep.sh script (it is on Github) it disables sleep on line 7. So sleep can be easily disabled by application, startup script, or cron job on your computer. There are applications which have little checkbox in Settings "disable sleep".
Also, if the Mac happens to be under IT management, some disable sleep on desktops to make sure they can run maintenance overnight. It should not be done on notebooks, but errors happen.
So it is impossible to tell you what specifically disables sleep on your particular computer. You will need to find offending applications/script/cron job and change their setting.
 

dottdirtt

macrumors newbie
Oct 9, 2018
11
15
I honestly can't think of an app I've installed that has an option to disable sleep let alone the ability to manually put the computer to sleep from the apple menu, ie greying out sleep in the menu. And especially since this issue has just suddenly started happening, with seemingly nothing to trigger it... other than potentially the 12.1 update ?
 
Last edited:

Love-hate 🍏 relationship

macrumors 68030
Sep 19, 2021
2,949
3,089
aha. i am but this issue has started since. BUT i believe aldente updated recently so maybe that was it. edit: but also i tried turning aldente off and it didn't fix the issue
you had set aldente to discharge because the battery was above your desired percentage.

doing so makes the helper gray the sleep option out and put the system to no-sleep mode .

unrelated to any update ,it's how the functionality works
 
  • Like
Reactions: Te0SX

Te0SX

macrumors regular
Jul 29, 2014
132
219
Screenshot 2022-01-28 at 12.23.44 AM.png


Exactly! I had my first crash here since I started using AlDente and this was the reason I had my Sleep button grayed as well.

Thanks to the guy above for the script and everyone else who contributed to the thread.
 

Te0SX

macrumors regular
Jul 29, 2014
132
219
@0089294 I used the command posted above by Srini Arumugam and it worked fine.

Btw I guess if you start the application, toggle the Discharge option and reboot, it should be back at normal again.
 

Love-hate 🍏 relationship

macrumors 68030
Sep 19, 2021
2,949
3,089
@0089294 I used the command posted above by Srini Arumugam and it worked fine.

Btw I guess if you start the application, toggle the Discharge option and reboot, it should be back at normal again.
you don't even have to reboot actually,just disabling discharge is fine ,that's all.

his command was amazing but only worked for a time as obviously aldente's helper will just restart the process and prevent the system from sleeping

good day
 

VentricleAffix

macrumors newbie
Feb 6, 2022
2
2
This helped me!
1. Log in with an account that has admin privileges

2. Open Terminal and run the following command:

1sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.PowerManagement SystemPowerSettings -dict SleepDisabled -bool NO
3. Restart the Mac (this is necessary to apply the change.)

After the restart, you should see that the Sleep command is available again in the Apple menu.
worked like a charm for me :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.