title: Linux Debian Run commands at boot in init script
body: <p>I'm new to Linux (obviously) and I need to run some commands whenever my Linux server boots without typing them into the console manually. </p>
  
  <p>I have this file called overpass.conf that runs on boot perfectly: </p>
  
  <pre><code>description 'Overpass API dispatcher daemon'
  
  env DB_DIR=/var/www/osm/db/
  env EXEC_DIR=/var/www/osm/
  
  start on (local-filesystems and net-device-up)
  stop on runlevel [!2345]
  
  pre-start script
      rm $DB_DIR/osm3s* || true
      rm /dev/shm/osm3s* || true
  end script
  
  exec $EXEC_DIR/bin/dispatcher --osm-base --db-dir=$DB_DIR 
  </code></pre>
  
  <p>However, I want to also run the following:</p>
  
  <pre><code>cp -pR "/root/osm-3s_v0.7.4/rules" "/var/www/osm/db/"
  
  nohup /var/www/osm/bin/dispatcher --areas --db-dir="/var/www/osm/db/" &amp; 
  
  chmod 666 "/var/www/osm/db/osm3s_v0.7.4_areas"
  
  nohup /var/www/osm/bin/rules_loop.sh "/var/www/osm/db/" &amp;
  </code></pre>
  
  <p>I have tried adding them to the bottom of the file, adding exec to the execution commands and even tried removing the quotes, then testing with <code>start overpass</code> but it throws errors if I add any commands to the original ones. </p>
  
  <p>How can I go about executing those 4 commands after the original ones? I'm a noob in distress. Thanks! </p>
  
  <p><strong>Edit</strong></p>
  
  <p>I solved it with these commands:</p>
  
  <pre><code>vi /etc/init.d/mystartup.sh
  </code></pre>
  
  <p>-Add commands to the script</p>
  
  <pre><code>chmod +x /etc/init.d/mystartup.sh    
  update-rc.d mystartup.sh defaults 99
  </code></pre>