I'm working on creating a headless media server out of my Raspberry Pi and there's a lot of junk that has to run on boot to make it useful. My question is what's the best way to run scripts in this way and what are the advantages or disadvantages?
Here are the two ways I've seen. I'm a big of a Linux noob so sorry if this seems trivial!
In most tutorials I read, it seems like you want to create a special script stored in /etc/init.d/and then run something like this:
sudo update-rc.d /etc/init.d/myScript defaults
I've done this and it works ok but the scripts seem a little long-winded with those LSB headers that I tend to screw up. Like the script at the end of this article.
But one tutorial I read had a very different method that involved creating a new config file inside of /home/pi/.config
The script written here was a lot simpler and looked like:
[Desktop Entry] Type=Application Name=TightVNC Exec=SIMPLE ONE LINE SCRIPT GOES HERE StartupNotify=false
So what's the difference between these two scripts. Is there any reason why I should use the former method, as opposed to the latter?