2

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 https://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.

1 Answer 1

1
  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

5
  • 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. Dec 12, 2012 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, 2012 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. Dec 12, 2012 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? Dec 12, 2012 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, 2012 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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