다음은 내 rc.local 파일의 내용입니다. sudo /etc/rc.local을 실행하면 정상적으로 작동합니다. 내가 부팅 할 때. 나는 monit이 설치되기를 기대하지만 그렇지 않다. 나는 총 손실에 처해있다. 나는 보통 rc.local을 사용하지만 이것은 오히려 혼란 스럽다.ec2의 우분투에서 rc.local이 작동하지 않습니다
#!/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
감사합니다. 나는 노력했지만 여전히 쓸모가 없다. 이것은 다소 이상합니다. – Tampa
두 줄로 rc.local을 시작하고 재부팅 할 때 일어나는 일에 대해 더 자세히 알려주십시오. /var/log/rc.local.log 파일이 생성 되었습니까? 무엇이 포함되어 있습니까? –
나는 동일한 행동을 발견했습니다. 재부팅 후에 /etc/rc.local가 호출되지 않습니다. – mark