If you want to execute a script on boot, use /etc/upstart. The following methods will NOT work:
- /etc/crontab/root with @reboot task
- /etc/init.d/
- /etc/rc.local
Make a file with the extension '.conf' and add a start condition and a stop condition as your first and second lines. Be sure your script and your .conf are unix format and not windows. (CRLF is bad and will make big problems.)
For example: /etc/upstart/fubar.conf
Code:
start on started lab126_gui
# This line tells init.d where in the boot process to start this script. Good
# places are "start on started framework" if you need it to run after the
# framework daemon is running. "start on started lab126_gui" tells it to run
# after the ui is up. That is the final phase of the boot process.
stop on stopping lab126_gui
# This tells the system when in the shutdown process to kill your script. If
# you are just running a single command, this isn't terribly important.
script
# exec /bin/sh /your/script/here.sh
exec /bin/bash /var/local/dev/somescript.sh
end script
** !! NOTICE !! ** !! NOTICE !! ** !! NOTICE !! ** !! NOTICE !! **
If you choose to remove whatever this conf points to, you MUST MUST MUST delete this from the upstart folder. If anything in this folder errors out there is a very good chance your kindle will fail to boot!
Original question: