title: rc.local on ubuntu on ec2 will not work
body: <p>Below are the contents of my rc.local file.  When I run sudo /etc/rc.local it works fine.  When I boot up and instance.  I expect monit to be installed but it is not.  I am at a total loss.  I usually use rc.local but this is rather confunsing.</p>
  
  <pre><code>#!/bin/sh -e
  #
  # rc.local
  #
  # This script is executed at the end of each multiuser runlevel.
  # Make sure that the script will "exit 0" on success or any other
  # value on error.
  #
  # In order to enable or disable this script just change the execution
  # bits.
  #
  # By default this script does nothing.
  
  apt-get -y install monit
  /etc/init.d/monit stop
  cd /home/ubuntu/workspace/rtbopsConfig/
  git fetch
  git checkout origin/master rtb_ec2_boot/ec2_boot.py
  git checkout origin/master config/
  cp /home/ubuntu/workspace/rtbopsConfig/config/monit/redis/monitrc /etc/monit/
  /usr/bin/python /home/ubuntu/workspace/rtbopsConfig/rtb_ec2_boot/ec2_boot.py &gt;&gt;  /home/ubuntu/workspace/ec2_boot.txt 2&gt;&amp;1
  
  /etc/init.d/monit start
  chkconfig monit on
  
  exit 0
  </code></pre>