I'm initializing spot instances running a derivative of the standard Ubuntu 13.04 AMI by pasting a shell script into the user-data field.
This works. The script runs. But it's difficult to debug because I can't figure out where the output of the script is being logged, if anywhere.
I've looked in /var/log/cloud-init.log, which seems to contain a bunch of stuff that would be relevant to debugging cloud-init, itself, but nothing about my script. I grepped in /var/log and found nothing.
Is there something special I have to do to turn logging on?
so I tried to replicate your problem. Usually I work in Cloud Config and therefore I just created a simple test user-data script like this:
Notice that, with CloudInit shell scripts, the user-data "will be executed at rc.local-like level during first boot. rc.local-like means 'very late in the boot sequence'" After logging in into my instance (a Scientific Linux machine) I first went to /var/log/boot.log and there I found:
So, as you can see, my script ran and was rightly logged. Also, as expected, I had my forced log 'output.txt' in /root/output.txt with the content:
So...I am not really sure what is happening in you script. Make sure you're exiting the script with
If it still doesn't work, you should provide more info, like your script, your boot.log, your /etc/rc.local, and your cloudinit.log. btw: what is your cloudinit version?