How do I make cloud-init startup scripts run every time my EC2 instance boots?

前端 未结 7 1122
抹茶落季
抹茶落季 2020-11-29 16:51

I have an EC2 instance running an AMI based on the Amazon Linux AMI. Like all such AMIs, it supports the cloud-init system for running startup scripts based on the User Data

相关标签:
7条回答
  • 2020-11-29 17:38

    In /etc/init.d/cloud-init-user-scripts, edit this line:

    /usr/bin/cloud-init-run-module once-per-instance user-scripts execute run-parts ${SCRIPT_DIR} >/dev/null && success || failure
    

    to

     /usr/bin/cloud-init-run-module always user-scripts execute run-parts ${SCRIPT_DIR} >/dev/null && success || failure
    

    Good luck !

    0 讨论(0)
提交回复
热议问题