Mr.Polymath
Posts: 1
Joined: Sun Sep 28, 2014 9:11 pm

Problem running a script on Start up

Sun Sep 28, 2014 9:30 pm

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!

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: Problem running a script on Start up

Wed Oct 01, 2014 4:16 am

SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

Return to “Troubleshooting”