title: EC2 instance loads my user-data script but doesn't run it
body: <p>Code:</p>
  
  <pre><code>#!/usr/bin/env python
  
  import boto.ec2
  
  conn_ec2 = boto.ec2.connect_to_region('us-east-1') # access keys are environment vars
  
  my_code = """#!/usr/bin/env python
  
  import sys
  
  sys.stdout = open('file', 'w')
  print 'test'
  """
  reservation = conn_ec2.run_instances(image_id = 'ami-a73264ce',
                                       key_name = 'backendkey',
                                       instance_type = 't1.micro',
                                       security_groups = ['backend'],
                                       instance_initiated_shutdown_behavior = 'terminate',
                                       user_data = my_code)
  </code></pre>
  
  <p>The instance is initiated with the proper settings (it's the public Ubuntu 12.04, 64-bit, image) and I can SSH into it normally. The user-data script seems to be loaded correctly: I can see it in <code>/var/lib/cloud/instance/user-data.txt</code> (and also in <code>/var/lib/cloud/instance/scripts/part-001</code>) and on the EC2 console. </p>
  
  <p>But that's it, the script doesn't seem to be executed. Following <a href="https://stackoverflow.com/a/10746289/2453555">this answer</a> I checked the <code>/var/log/cloud-init.log</code> file but it doesn't seem to contain any error messages related to my script (well, maybe I'm missing something - <a href="https://gist.github.com/thiagomarzagao/6fdc3d847936f6f83860" rel="nofollow noreferrer">here is a gist</a> with the contents of cloud-init.log). </p>
  
  <p>What am I missing?</p>