bamarni / pi64

A 64-bit OS for the Raspberry Pi 3
712 stars 128 forks source link

Is there an equivalent to rc.local? #53

Closed DanielSSilva closed 6 years ago

DanielSSilva commented 6 years ago

I'm fairly newbie into linux. I want to run a script upon starting up the pi. On raspbian i know we can use rc.local to achieve that , but I can't find that on this OS. What's the best way to achieve this? Thank you!

mohakshah commented 6 years ago

You could use @reboot in your crontab. See https://www.raspberrypi.org/documentation/linux/usage/cron.md

DanielSSilva commented 6 years ago

Totally forgot about crontab.... Why there's no such file as rc.local?

bamarni commented 6 years ago

Seems like this has been removed by default on recent Debian (https://stackoverflow.com/questions/44797694/where-is-rc-local-in-debian-9-debian-stretch), you could also use systemd directly for this (https://askubuntu.com/questions/919054/how-do-i-run-a-single-command-at-startup-using-systemd).

DanielSSilva commented 6 years ago

@bamarni thank you for your answer. I've been using rc.local but I forgot that I was on previous version