Topic: Best place to launch a startup script?

I want run run a script that resumes interrupted downloads every time the Chumby reboots, but I don't want it to launch untill all the housekeeping chores (downloading Control Panel, scanning attached drives for media, etc) is complete.  I'm guessing I need to place the script in /etc/init.d or call it from one of the existing scripts.  Thanks

Re: Best place to launch a startup script?

You can put it at the end of /etc/init.d/rcS.background, but since start_control_panel is forked, you may have a race condition between downloading/launching the control panel and whatever your script may be doing.

You could launch your script at the end of rcS.background and have the script block until both /tmp/flashheartbeat and /tmp/movieheartbeat have been created, which indicates that the control panel has been downloaded and is running.  This doesn't tell you whether the control panel has finished scanning attached drives, however.

Re: Best place to launch a startup script?

Thanks Ken, maybe I'll add a timer loop to give it time to finish scanning.