/etc/init.d/remoled를 만들었으면
이걸 부팅 시에 실행하도록 등록해 줘야 한다
등록하는 명령
sudo update-rc.d /etc/init.d/remoletd defaults
또는
sudo update-rc.d remoletd defaults
NOTE: the following steps usually require root permissions. So just issue every command with sudo or log into a root shell (sudo -s, beware that everything you do is done with root permissions!!)
Code: Select all# update boot / reboot files
cp <your script> /etc/init.d/
# do it as soon as the device is going down,
# both for shutdown and reboot
update-rc.d /etc/init.d/<your script> defaults
(If I couldn't have been clear enough, this has to be done after looking at the following part...)
The <your script> part is something like the following:
Code: Select all#! /bin/sh
### BEGIN INIT INFO
# Provides: <your script name>
# Required-Start: $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Manage my cool stuff
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin
. /lib/init/vars.sh
. /lib/lsb/init-functions
# If you need to source some other scripts, do it here
case "$1" in
start)
log_begin_msg "Starting my super cool service"
# do something
log_end_msg $?
exit 0
;;
stop)
log_begin_msg "Stopping the coolest service ever unfortunately"
# do something to kill the service or cleanup or nothing
log_end_msg $?
exit 0
;;
*)
echo "Usage: /etc/init.d/<your script> {start|stop}"
exit 1
;;
esac
That's it

Another way (but hackish) I used to do on an embedded system (but because that was not a debian, so beware, it seems more simple but an update of the system might screw it up) is to modify the /etc/profile.
'실전 임베디드' 카테고리의 다른 글
| bluetooth raspberry pi에서 HC-06으로 연결하기. 페어링 까지만. 실전 임베디드 2016. 2. 11. 16:44 (0) | 2019.09.22 |
|---|---|
| raspberry pi bluetooth 실전 임베디드 2016. 2. 11. 15:17 (0) | 2019.09.22 |
| raspberry pi keyboard layout 실전 임베디드 2016. 2. 5. 14:52 (0) | 2019.09.22 |
| raspberry pi wifi가 자꾸 잠을 자요... 실전 임베디드 2016. 1. 29. 20 (0) | 2019.09.22 |
| bluetooth rfcommclient rfcommserver 실전 임베디드 2016. 2. 11. 15:27 (0) | 2019.09.22 |