title: EC2 init.d script - what's the best practice
body: <p>I'm creating an init.d script that will run a couple of tasks when the instance starts up.</p>
  
  <ul>
  <li>it will create a new volume with our code repository and mount it if it doesn't exist already.</li>
  <li>it will tag the instance</li>
  </ul>
  
  <p>The tasks above being complete will be crucial for our site (i.e. without the code repository mounted the site won't work). How can I make sure that the server doesn't end up being publicly visible? Should I start my init.d script with de-registering the instance from the ELB (I'm not even sure if it will be registered at that point), and then register it again when all the tasks finished successfully?
  What is the best practice?
  Thanks!</p>