rc.local on ubuntu on ec2 will not work

Posted by Tampa on Stack Overflow See other posts from Stack Overflow or by Tampa
Published on 2012-03-25T01:02:23Z Indexed on 2012/10/04 21:38 UTC
Read the original article Hit count: 173

Filed under:
|
|

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.

#!/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 >>  /home/ubuntu/workspace/ec2_boot.txt 2>&1

/etc/init.d/monit start
chkconfig monit on

exit 0

© Stack Overflow or respective owner

Related posts about ubuntu

Related posts about amazon-ec2