User-data scripts is not running on my custom AMI, but working in standard Amazon linux

后端 未结 11 1383
南方客
南方客 2020-12-08 02:15

I searched a lot of topic about \"user-data script is not working\" in these few days, but until now, I haven\'t gotten any idea about my case yet, please help me to figure

11条回答
  •  心在旅途
    2020-12-08 02:42

    The only way I get it to work was to add the #cloud-boothook before the #!/bin/bash

    This is a typical user data script that installs Apache web server on a newly created instance

    #cloud-boothook
    #!/bin/bash
    
    yum update -y 
    yum install -y httpd.x86_64 
    systemctl start httpd.service 
    systemctl enable httpd.service 
    

    without the #cloud-boothook it does not work, but with it, it works. It seems that different users have different experiences. Some are able to get it to work without it, not sure why.

提交回复
热议问题