Auto Run a file on Boot on Dietpi


On regular Raspberry Pi image (for headless / no monitor setup) , there is option to run a local file on boot using the entry on /etc/rc.local

on Dietpi, I dont find the file. How do I run a file on boot.

Do I use the dietpi-autostart to use a
Does this run the file in background or does this only work on console / desktop?

Thanks for your help!


basically /etc/rc.local has been deprecated and is not used anymore to start service during boot process. Nowadays this is done by systemd. Even Raspberry Pi Foundation is not recommending the usage

You have following options to get a script running during boot

  1. create your own service using systemd
  4. using crontab to have a script exeuted during boot
  5. dietpi-config AutoStart Option - Custom, will create as well a systemd service dietpi-autostart_custom and can be used to execute your command at boot

Thank you Joulinar !!