Score:0

Remember /sys/power/mem_sleep setting after reboot

br flag

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

Score:0
br flag

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
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.