cri.dev 🤦‍♂️ about ✍️ posts 🗞️ rss

Start Kindle script on system boot with init.d

Published on

To manage your custom Kindle scripts I found the following trick super useful.

Let’s say you have a script that shows the time on your Kindle e-ink display, under /bin/custom-clock

Place your script configuration under /etc/init/<your-script>.conf (e.g. /etc/init/custom-clock.conf) with the following content:

start on started lab126_gui
stop on stopping lab126_gui

pre-start script
  # important test to verify your script exists, else it could impact the boot of the kindle
  test -x /bin/custom-clock || { stop; exit 1; }
end script

exec /bin/custom-clock

After a reboot, you’ll be able to manage your service (if needed) using the following commands:

stop custom-clock
start custom-clock

Here, have a slice of pizza 🍕