You are not logged in.
I like to set /sys/devices/system/cpu/sched_smt_power_savings to 1 on my laptop. This requires superuser privileges and sudo doesn't work. So,
sudo -s
echo 1 > /sys/devices/system/cpu/sched_smt_power_savingsI put this command into /et/rc.local to run at the boot, but it doesn't work. I tried:
sleep 10; echo 1 > /sys/devices/system/cpu/sched_smt_power_savings- in case something overrides this setting, like KDE or whtaver, and even sleep 20, still nothing.
At the same time, running echo 7 > /sys/class/backlight/acpi_video0/brightness from /etc/rc.local works OK.
What am I doing wrong? ![]()
Offline
This requires superuser privileges and sudo doesn't work.
Sure it does. You just have to use it properly.
$ sudo bash -c 'echo 1 >/sys/devices/system/cpu/sched_smt_power_savings'
# or...
$ echo 1 | sudo tee /sys/devices/system/cpu/sched_smt_power_savings >/dev/nullsudo applies to the command you prefix it with. It does not apply to redirections, which are setup by the shell before the command is actually invoked.
No idea why it doesn't work from rc.local. Add logging to find out why.
set -x exec >/run/rclocal.log 2>&1 echo 1 >/sys/devices/system/cpu/sched_smt_power_savings cat /sys/devices/system/cpu/sched_smt_power_savings
Offline
@falconindy
Thanks for your reply!
sudo applies to the command you prefix it with. It does not apply to redirections, which are setup by the shell before the command is actually invoked.
This is logical. I'm ashamed.
No idea why it doesn't work from rc.local. Add logging to find out why.
Here we go:
[ajaxas@r2d2 ~]$ cat /run/rclocal.log
+ echo 1
+ cat /sys/devices/system/cpu/sched_smt_power_savings
1
[ajaxas@r2d2 ~]$ cat /sys/devices/system/cpu/sched_smt_power_savings
0So I'd say, something else changes this after the boot (kde?).
I didn't find anything in /etc, what could it be?..
Offline
So I'd say, something else changes this after the boot (kde?).
I didn't find anything in /etc, what could it be?..
I guess something power-saving related does.
I use tlp for my T400,I did some setups in the rc.local as you did here.when boot completed,tlp set the settings to the default of tlp.
For example,when I plug in the AC adaptor,sched_smt_power_savings or sched_mc_power_savings is set to default '0' by tlp.
Offline