Learning why a Shell Script is not run in boot sequence – Troubleshooting in Raspberry Pi Development

What I want to achive

(but did not so far…)

I want a Raspberry Pi to automatically run a slideshow after the boot sequence.

How I thought I’d do that

I have a working shell script that launches the slideshow:

sudo fbi -T 1 -noverbose -a -t 2 PathToMyPictures/*

I added a new service to /etc/init.d to be run when the machine boots:

# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
    set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
# Provides:          slideshow
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: runs slideshow on start
# Description:       This file automatically runs a slideshow script found at /home/pi/slideshow/slideshow.sh
# Author: Johannes Kalt <my@mailaddr.es>
sudo /home/pi/slideshow/slideshow.sh

I set the rights for this file to 755 using:

sudo chmod 755 /etc/init.d/flickrd

I added the necessary links using update-rc.d as:

update-rc.d flickrd defaults

What is happening

In the boot sequence the shell script is run as I get a message of the slideshow program fbi stating PathToMyPictures/* loading FAILED.

When I manually start the script using sudo /etc/init.d/MyService start the script is run thus the slideshow shown.

Resources I’ve been using to find an answer (but did not so far)


in German:

Raspberry Pi: Autostart von Programmen einrichten


I’ll be happy to read your comments and thoughts to get on with my troubleshooting!

Leave a Reply

Your email address will not be published. Required fields are marked *

three + eighteen =