0

I have a raspberry pi zero w and I need to add a python script to startup just by editing the files in boot unit, instead of adding a line to cron using terminal. Thanks for help.

6
  • Not sure what you mean by "boot unit" but if you are just tying to get a program to run when the pi boots by simply editing a file, maybe try rc.local? Take a look at raspberrypi.org/documentation/linux/usage/rc-local.md – jrel Dec 4 '20 at 17:54
  • boot unit likely means the fat32 boot partition on sd. to do this can involve calling something on boot from rc.local or other means, or replacing init to do extra stuff if strictly limited to boot of default image: raspberrypi.stackexchange.com/questions/33817/… – Abel Dec 4 '20 at 19:14
  • I'll check rc.local, thanks – user127471 Dec 4 '20 at 20:59
  • @jrel Please never suggest to use rc.local anymore. Even the link have a "NOTE:". Please respect it. Using /etc/rc.local has limitations due to Compatibility with SysV. We have seen many problems here on this site using it. Following the recommendation of the developers from systemd you should avoid using it. – Ingo Dec 5 '20 at 20:51
  • @user127471 You should use a systemd Unit file. – Ingo Dec 5 '20 at 20:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.