0

I had this solution for the question Macbook takes 20 seconds to wake up where I had to run echo s2idle | sudo tee -a /sys/power/mem_sleep in order to set /sys/power/mem_sleep to [s2idle] deep But after some update that change is not remembered after reboot, and that setting is reverted to s2idle [deep].

How can that be fixed so that the needed setting is remembered?

(Or even better - maybe someone has a better solution to the initial problem linked above.)

enter image description here

cipricus
  • 3,444
  • 2
  • 34
  • 85

1 Answers1

0

This is a matter of running a script after reboot as root.

sudo crontab -e

Selecting nano, added a record to the bottom, containing the path to my script (mentioned in answer under link in question):

@reboot path/to/script/to/be/run/as/root 

The script is:

#!/bin/sh
echo s2idle | sudo tee -a /sys/power/mem_sleep

We can see user's and root's crontab entries as follows:

crontab -l       # list your user crontab entries
sudo crontab -l  # list root's crontab entries
cipricus
  • 3,444
  • 2
  • 34
  • 85