title: Shell Script on Boot up does not execute on Raspberry pi
body: <p>I want to run the following commands just after bootup of Raspberry Pi running the raspbian wheezy:</p>
  
  <ol>
  <li><code>sudo gcc -lpthread server.c -o wifiserver.o</code></li>
  <li><code>sudo ./wifiserver.o</code></li>
  </ol>
  
  <p>I created the following files and ran the following steps:</p>
  
  <ol>
  <li><p>Created a script file named <code>auto_server_start</code>.</p></li>
  <li><p>Contents are as follows:</p>
  
  <pre><code>#!bin/bash
  # /etc/init.d/auto_server_start
  ### BEGIN INIT INFO
  # Provides: auto_server_start
  # Required-Start: $all
  # Required-Stop: $remote_fs $syslog
  # Default-Start: 2 3 4 5
  # Default-Stop: 0 1 6
  # Short-Description: wifi server script
  # Description: Start wifi server at bootup
  ### END INIT INFO
  
  case "$1" in
    start)
      echo "running server program"
      sudo gcc -lpthread server.c -o wifiserver.o
      sudo ./wifiserver.o
      ;;
    stop)
      echo "stopping customized script"
      ;;
    *)
      echo "Usage: /etc/init.d/auto_server_start start|stop"
      exit 1
      ;; 
  esac
  
  exit 0
  </code></pre></li>
  <li><p>Copied this file named <code>auto_server_start</code> to <code>/etc/init.d/</code> directory and added execute permission using <code>chmod +x</code>.</p></li>
  <li><p>Then <code>sudo update-rc.d auto_server_start defaults</code>.</p></li>
  </ol>
  
  <p>It gave some warning about mathkernel but I don't think that has anything to do with my script.</p>
  
  <p>However on soft reboot I checked <code>ps -e</code> as well as <code>top</code>, nowhere does my <code>wifiserver</code> process show up.</p>
  
  <p>Please suggest.</p>
  
  <p>PS: I checked that the commands <code>gcc</code> and <code>./wifiserver.o</code> were giving no warning and errors.</p>