title: Run Linux Shell Script On Boot
body: <p>I have a Shell script that I want to run on boot. Every time that I start the device It'll run the script in the background. 
  The script contains a while true loop and suppose to run constantly, at least until the device will be turned off. This is the script :</p>
  
  <pre><code>#!/bin/bash
  
  cd /home/.../
  while true 
  do 
    sh ./update_logs.sh
  sleep 1
  done
  </code></pre>
  
  <p>After of plenty of searches I've came up with too much information which made a salad in my head. I've been advised to get to this folder <code>/etc/init.d</code> and put down my script there by using special pattern (LSB-compliant) which looks like this :</p>
  
  <pre><code>!#/bin/sh
  
  start () {
      echo "application started";
      ./helloworld  # you should use an absolute path here instead of ./
  }
  
  stop () {
  
  }
  
  case "$1" in
      start)
          start
          ;;
      stop)
          stop
          ;;
      *)
          echo "Usage start|stop";
  esac
  
  exit $?
  </code></pre>
  
  <p>Make the script executable by chmod +x, then make A symbolic link for the file by typing <code>ln -s /etc/rc.d/init.d/run_update.sh /etc/init.d/rc5.d/S90run_update</code></p>
  
  <p>This supposed to be the "hard way" while the "easy way" is putting my script in a folder <code>/etc/rc.local</code> where it shall boot my script after the main boot process. </p>
  
  <p>Well, I don't have this kind of folder. What I to have in <code>etc</code> folder is <code>rc.d</code> which leads to sub folders : <code>init.d</code> <code>rc0.d</code> <code>rc1.d</code> <code>rc2.d</code>... <code>rc6.d</code></p>
  
  <p>If the solution is the hard way by writing the code above, what is the minimum that I need to include in it? since I see different type of codes which include ### with descriptions and run levels
  I have a Linux Red Hat 4.6.3-2.</p>