Run Script on Startup with Raspbian Jessi Wheezy and Raspberry Pi2b
<p>I know there are lots of posts on this topic, but depite working through many many many of them I cant get this working.</p>

<p>I have a raspberry pi2b with raspbian jessie wheezy.</p>

<p>I want to run this framebuffer command automatically on startup:</p>

<p><code>sudo /usr/bin/fbi -T 1 -t 1 -1 -a -noverbose /home/pi/Pictures/*.jpg</code></p>

<hr>

<p>I initially edited rc.local and into it I tried each of these commands but nothing happened on startup:</p>

<p><code>sudo /usr/bin/fbi -T 1 -t 1 -1 -a -noverbose /home/pi/Pictures/*.jpg</code></p>

<p>and</p>

<p><code>sudo fbi -T 1 -t 1 -1 -a -noverbose /home/pi/Pictures/*.jpg</code></p>

<hr>

<p>so then I created a script called <code>script_auto_run</code> in my /home/pi/projects/test folder containing the following code:</p>

<pre><code>#!/bin/bash
# Script to start our application
sudo /usr/bin/fbi -T 1 -t 1 -1 -a -noverbose /home/pi/Pictures/*.jpg
</code></pre>

<p>into rc.local I placed </p>

<pre><code>sudo /home/pi/projects/test/script_auto_run
</code></pre>

<p>Again nothing happens on startup</p>

<hr>

<p>So then I re-created my <code>script_auto_run</code> file in my <code>/etc/init.d</code> folder and its contents are as follows:</p>

<pre><code>#!/bin/bash
# /etc/init.d/script_auto_run
### BEGIN INIT INFO
# Provides:          servoblaster
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Example initscript
# Description:       This service is used to manage a servo
### END INIT INFO
sudo /usr/bin/fbi -T 1 -t 1 -1 -a -noverbose /home/pi/Pictures/*.jpg
exit 0
</code></pre>

<p>I ran the <code>sudo chmod +x /etc/init.d/script_auto_run</code> command and then edited my rc.local yet again to the following line:</p>

<pre><code>sudo /etc/init.d/script_auto_run
</code></pre>

<hr>

<p>None of these are working. I can run rc.local or script_auto_run from the terminal manually and there is no problem. But they are not executing automatically on startup. Raspbian is just booting to the GUI as normal.</p>