Need to launch a command at boot-up as root

Hello,

I’m trying to find a way to launch this command at start-up as root.

echo "1" | sudo tee /sys/devices/system/cpu/intel_pstate/no_turbo 

I’ve tried Kcron (from the kde settings menu) but I don’t see any way to specify that it must be run as root.

Thanks !

Hi
Create a systemd service in /etc/system/systemd and enable…


# /etc/systemd/system/intel_turbo.service
#

[Unit]
Description=Disable intel pstate turbo
After=network.target

[Service]
Type=oneshot
ExecStart=/bin/sh -c "echo '1' > /sys/devices/system/cpu/intel_pstate/no_turbo"

[Install]
WantedBy=multi-user.target

Thanks, that’s perfect :smiley:

Although the recommendation may work,
I’d think that type of command which is actually to set a CPU parameter would likely have been better executed as a boot parameter…

TSU

Hi
Maybe, it’s not modular, but if it doesn’t work then sysfs is the way… intel_pstate=no_turbo or intel_pstate.no_turbo=1 should work as a boot option…