This project has been superseeded by andsens/bootstrap-vz and is no longer maintained - Script to create Debian Squeeze & Wheezy Amazon Machine Images (AMIs) and Google Compute Engine images
Other
117
stars
43
forks
source link
run user data script doesn't correctly run compressed user data. #103
With services like OpsWorks simply decompressing the user data isn't enough because they pack mime multipart files into the user-data text.
I use the munpack command to expand the files list then using the munpack output which gives you the mime type to select the correct file for execution. If you use this code you need to make sure that the mpack package is installed.
I've created a new temporary directory here since munpack expands the user-data to multiple files and I wanted to keep things clean.
I had to replace the decompression part of the code in /etc/init.d/ec2-run-user-data with the following..
With services like OpsWorks simply decompressing the user data isn't enough because they pack mime multipart files into the user-data text.
I use the munpack command to expand the files list then using the munpack output which gives you the mime type to select the correct file for execution. If you use this code you need to make sure that the mpack package is installed.
I've created a new temporary directory here since munpack expands the user-data to multiple files and I wanted to keep things clean.
There is more information about the format here: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonLinuxAMIBasics.html#CloudInit