rc.local not executing commands

silver.bullet at zoho.com silver.bullet at zoho.com
Thu Nov 5 13:57:40 UTC 2015


On Thu, 5 Nov 2015 13:40:32 +0000, R Kimber wrote:
>What do I need to do to get a command (cpufreq-set) in rc.local to be
>executed ?
>
>rc.local is itself executable:
>-rwxr-xr-x 1 root root 348 Nov  5 13:27 /etc/rc.local
>
>and the command
>     sudo /usr/bin/cpufreq-set -u 4.0Ghz
>works fine from the command line.
>
>Is this a bug? Or is there some piece of configuration I need to fix?

You did not mention what Ubuntu you are using, resp. what startup
process your Ubuntu does use.

If you're using systemd, then use an unit, to

  /lib/systemd/system/

write a file named

  cpu_freq_scaling.service

with this content:

  [Unit]
  Description=cpu_freq_scaling

  [Service]
  Type=oneshot
  ExecStart=/usr/bin/cpufreq-set -u 4.0Ghz
  RemainAfterExit=true

  [Install]
  WantedBy=multi-user.target

then run

  sudo -i
  systemctl start cpu_freq_scaling
  systemctl enable cpu_freq_scaling

Regards,
Ralf





More information about the ubuntu-users mailing list