Comment 1 for bug 1086646

Revision history for this message
Scott Moser (smoser) wrote :

Hi,
  Thanks for taking the time to open a bug and help in making Ubuntu better.
  I'm not able to recreate the issue you're seeing. Working off the doc at https://help.ubuntu.com/community/CloudInit . I've attached the user-data that was created by write-mime-multipart, but here is what I did to try to reproduce:

# ami-9c78c0f5 = us-east-1 ubuntu-precise-12.04-amd64-server-20121026.1

$ cat my-boothook
#!/bin/sh
echo "=== $(date): running $0 $* ===" | tee -a /root/boothook.log
echo myhostname > /etc/hostname

$ cat my-userscript
#!/bin/sh
echo "=== $(date): running $0 $* ===" | tee -a /root/userscript.log

$ write-mime-multipart --output=userdata.txt \
   my-boothook:text/cloud-boothook my-userscript:text/x-shellscript

$ euca-run-instances --key=brickies --instance-type=t1.micro \
   --user-data-file=userdata.txt ami-9c78c0f5

Then, inside the instance I did:
$ sudo sh -c 'for f in /root/*.log; do echo "#$f"; cat $f; done'
#/root/boothook.log
=== Wed Dec 5 19:09:36 UTC 2012: running /var/lib/cloud/instances/i-06d52c78/boothooks/my-boothook ===
#/root/userscript.log
=== Wed Dec 5 19:09:49 UTC 2012: running /var/lib/cloud/instance/scripts/my-userscript ===

That shows that the scripts ran 13 seconds apart (one early in boot and one later). And by their names, its clear that one ran as a boothook and one as a user-script.