티스토리 뷰
목차
라즈베리파이 부팅 시 자동 실행할 수 있는 방법에 대해 알려드리도록 하겠습니다
- 목표
재부팅 시 필요한 프로그램을 자동으로 실행하도록 설정한다.
- 배경
라즈베리파이를 한 동안 오래 켜 놓을 시 메모리 관리가 안되어 꺼지는 경우 혹은 느려지는 것을 방지하기 위해 재부팅을 수행한다.
- 장점
startx까지 모두 실행한 후에 실행되므로 crontab으로 불가능한 GUI프로그램들도 모두 잘 작동한다.
추가(21.3.28) - rc.local(부팅시 스크립트 자동 실행) 확인해보기
- 단점
재부팅 후 계정 로그인 해야 프로그램이 실행된다.
ㄴraspberry pi auto login으로 해결 가능
https://raspberrypi.stackexchange.com/questions/48241/auto-login-in-jessie-how
------------
부팅 시 바로 실행 시키고 싶은 파일을 설정하기 위해 autostart파일을 수정한다.
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
출처:https://learn.sparkfun.com/tutorials/how-to-run-a-raspberry-pi-program-on-startup/all
How to Run a Raspberry Pi Program on Startup - learn.sparkfun.com
Introduction The Raspberry Pi is a great single board computer, but like most computers, its functions rely mostly on human input. That means whenever you start up (or boot) your computer, it waits for your input to run programs. That's great, but how do w
learn.sparkfun.com