Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

I have following scenario. I cloned Raspcontrol via git, and the repo is now located in /home/pi. Using ls, I can see the Raspcontrol folder. Inside, there's a start.sh for it to run. I decided to make it run on startup, and I came across this article in http://stackoverflow.com/questions/7221757/run-automatically-program-on-startup-under-linux-ubuntu

So, here's my question:

  1. Should I just put replace filename with start.sh, and run those commands?
  2. What is update-rc.d?
  3. If I don't want to change the structure of Raspcontrol (not moving start.sh), what are the other ways to achieve the same thing?

PS: I'm not sure which tag should be used, please edit it if you find it appropriate.

share|improve this question

1 Answer 1

up vote 1 down vote accepted
  1. Yes. Just replace filename with start.sh.
  2. It's like a collection of files. These files are run when changing run levels. Almost like the "startup" folder in Windows, all the files will run everytime a run level is changed. But it's mostly used to run files on startup, which is technically "changing" a run level. Think of it as a pool of files that will be run at startup, files can be removed as well.
  3. If you mean that you dont want to move the start.sh file. Then rather use the following command to make the file run at startup

    update-rc.d start.sh defaults

share|improve this answer
    
Thanks, but I do have 2 extra questions, I just need to type update-rc.d <i>filename</i> defaults? Do I need to specify the actual path? Like /home/pi/Rhascontrol/start.sh. –  Tan Jia Ming Dec 12 '12 at 13:36
    
Yes you must specify the path. But if your in the folder with the start.sh file. you can just type update-rc.d start.sh defaults. Meaning that the path to the file can be relative. –  Vincent P Dec 12 '12 at 13:42
    
Thanks a lot! I actually tried to edit my comment, to ask 1 more question, but I get disconnected from my network from the same time. Maybe I will post another question. –  Tan Jia Ming Dec 12 '12 at 13:45
    
I actually tried the command, but I get the following: update-rc.d: using dependency based boot sequencing update-rc.d: error: unable to read /etc/init.d/start.sh. Means I still need to put start.sh into /etc/init.d? –  Tan Jia Ming Dec 12 '12 at 13:50
    
Try running the following 2 commands sudo update-rc.d rpcbind defaults and sudo update-rc.d nfs-common defaults and then try running the original command. –  Vincent P Dec 12 '12 at 14:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.