1

If I paste a shell script into the user-data box when starting the standard Ubuntu AMI on EC2, I'm using cloud-init, am I not? My question is where does it log the output of such a script? Do I have to do something to turn logging on? I can't find logs for it anywhere.

Ubuntu-raring-13.04-amd64-server-20130423 (ami-c30360aa)

Thanks!

cbare
  • 113
  • 1
  • 1
  • 5

2 Answers2

6

Output of your program is available on the console log. You can get that either from the aws console, or by calling the GetConsoleOutput via the api (or with a tool such as euca-get-console-output or ec2-get-console-output).

Additionally, you can tell cloud-init to log the output of those commands by providing user-data that tells it to.

#cloud-config
output: {all: '| tee -a /var/log/cloud-init-output.log'}

You can provide multi-part input to give both '#!' scripts and cloud-config as shown above. See https://help.ubuntu.com/community/CloudInit for an example of how to do that.

smoser
  • 1,825
0

You will found all log in the following folder :

/var/log/installer/

You can find there after installation too. Interesting file :

/var/log/installer/installer-journal.txt
/var/log/installer/autoinstall-user-data
/var/log/installer/curtin-install.log

Hop it's help