How do I auto-run a program on a Pi 4?

I am going to build a robot car that will move around.

2 Answers

  • Anonymous
    1 month ago

    If you setup Pi-Hole with regular automated setup then yes it will. I’ve witnessed it a few times recently as I’ve been reworking my network. I’ve had to restart my Raspberry Pi a couple times and each time Pi-Hole starts up by itself without any intervention

  • 1 month ago

    That depends somewhat on the version of linux in use, but typically you can add a line (or several) to the rc.local file, as that is executed as the last stage of the operating system starting up.

    Or you can use a cron entry to run a script at regular intervals that does a check, starting your program if it is not running or killing & restarting it if it has locked up..

    In newer versions of linux, you may need a systemd script rather than rc.local

    More info and details here:

Still have questions? Get your answers by asking now.