[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: AWS user-data doesn't works



But if I create an AMI of this instance
Good of you to mention that you are not actually running the original AMI.....
I repeat:
> it removes itself from startup after the first boot.
So you see? If you create an AMI of a booted instance the script will not run again, you have to manually re-add it with `insserv -d ec-run-user-data`


Anders


On 14 September 2013 18:11, Matthieu Boret <mboret86@gmail.com> wrote:
yes it's true, the user-data script is executed only at the first boot. 
If I launch the Debian 7.1 with user-data, it works.
But if I create an AMI of this instance, the user-data is not execute for the instances launched with this AMI.

It's disturbing, because with the offical AWS linux AMI, I can create AMI of her and the user-data works for instance launched by this custom AMI.


2013/9/14 Anders Ingemann <anders@ingemann.de>
The script should run only once, it removes itself from startup after the first boot.
One of these messages should show up when you run dmesg (or if you click "show boot log" in the AWS console).
* No user-data available
* Skipping user-data as it does not begin with #!
* Running user-data


Anders


On 14 September 2013 14:23, Matthieu Boret <mboret86@gmail.com> wrote:
Hi,

Thanks for your help. I've try with head -n 1 but nothing happening. It seems that the ec2-run-user-data command is not executed during boot time. 
After booting if I run /etc/init.d/ec2-run-user-data  it works well.

I've nothing in syslog about his execution...

Very strange


2013/9/14 Anders Ingemann <anders@ingemann.de>
Assuming the script runs on startup, the fault should be here: https://github.com/andsens/build-debian-cloud/blob/master/init.d/ec2-run-user-data#L36
Is `head -1` correct usage, shouldn't it be `head -n 1`?


Anders


On 14 September 2013 12:38, Matthieu Boret <mboret86@gmail.com> wrote:
Hi,

I'm on AWS and I use the latest version of the Debian AMI(7.1 from the marketplace). She's works well but I've just one issue with the execution of my user-data. 

He's not executed during the boot. 

However he begins with #!/bin/bash

I've try with this simple script:

#!/bin/bash
echo "toto" > /tmp/test.log

But nothing is happening.

If I do a curl to retry my user-data, I can see my script:


Someone has an idea?

Thanks 

Matthieu






Reply to: