Hello,
I'm doing a project using a PIR sensor to reproduce a song with the Raspberry Pi when someone walks in front of the sensor.
I've written a code in java to do this and I wanted to execute that script on start up.
To do this I run a script at boot time from /etc/init.d/scriptname (copied from /etc/init.d/skeleton and enabled with the update-rc.d command).
This script seems to work properly if I execute it with: sudo /etc/init.d/scriptname start
but when I reboot the Raspberry Pi to check if it works on start up I find that the script runs only for a second.
(The reason I know this is that when the script runs my headphones start doing an anoying backround noise, and when I reboot the Raspberry, after all the code dissapears and the screen gets black for a few seconds, the sound appears for a second and then dissapears again)
My question is, how can I make the program run indefinetly?
Thank you very much!