Start up commands

6,195

You can just create the file /etc/rc.local and make it executable, then put this in it:

#!/bin/sh
hdparm -y /dev/sdc
Share:
6,195

Related videos on Youtube

Dragon8oy
Author by

Dragon8oy

Updated on September 18, 2022

Comments

  • Dragon8oy
    Dragon8oy over 1 year

    I want to run a command or script as root while booting, like just before login. I have tried the solution i used until 17.10, but after a fresh install of 18.04, I no longer have an /etc/rc.local. The command is hdparm -y /dev/sdc to put that drive into sleep, but it only works with root.

    Thanks for any help.

  • Dragon8oy
    Dragon8oy about 6 years
    Ok, I'll try it later.
  • jarno
    jarno over 4 years
    @Dragon8oy so did it work? You could examine the status of systemd rc.local.service by systemctl status rc-local.service.
  • Dragon8oy
    Dragon8oy over 4 years
    I think it worked, I don't have that install anymore and removed the drive I was powering down since then.