if you want to start a script off when your RPi boots up there are various ways but here is one that is very useful.
1) make sure your script runs [this is always useful

2) edit /etc/inittab with your favourite root mode editor [I use sudo vi /etc/inittab YMMV]
2a) find the line
Code: Select all
1:2345:respawn:/sbin/getty 115200 tty1
Code: Select all
1:2345:respawn:/bin/login -f USERNAME tty1 </dev/tty1 >/dev/tty1 2>&1
...what this does is an autologin on tty1 [the 1st terminal]
then edit .bashrc on that user
and right at the end put something like :-
Code: Select all
if [ $(tty) == /dev/tty1 ]; then
./script
fi
so what happens is when the RPi is booted the 1st terminal will run your script - other terminals will want a login and if you login with your normal user will not auto run your script
if your script exits then you will be left at a command prompt, if you exit it will run again