user-data scripts are run on first boot after a rebundle

Bug #675711 reported by Scott Moser
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Scott Moser
cloud-init (Ubuntu)
Fix Released
Medium
Scott Moser

Bug Description

Binary package hint: cloud-init

As reported at [1], there if a instance is launched with a user data script (--user-data-file that has '#!'), then that script will persist across a rebundle *and* be run on first boot after the rebundle. That is not the desired behavior.

This problem probably exists with runcmd commands also (via cloud-config syntax).

For simplicity, I copied the report here:

| IMHO there is still a problem. It might be a feature though that I never understood.
| I start an AWS micro instance (EBS based obviously) instance with userdata:
|
| #!/bin/bash
| date > /tmp/x
|
| I check for the date stamp. it is there.
|
| then I stop the image, delete /tmp/x and create a new image of the one above.
|
| I run another instance based on the new AMI, but this time WITHOUT user-data.
|
| I check for the /tmp/x file. It is there. And it contains the new timestamp!
|
| So is the user-data persisted and used again when creating a new image?
| Is it a bug or a feature? If it is a feature, is it documented :-)

--
[1] https://forums.aws.amazon.com/thread.jspa?threadID=52433

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: cloud-init 0.5.15-0ubuntu3
ProcVersionSignature: User Name 2.6.35-22.33-virtual 2.6.35.4
Uname: Linux 2.6.35-22-virtual i686
Architecture: i386
Date: Mon Nov 15 19:35:45 2010
Ec2AMI: ami-508c7839
Ec2AMIManifest: (unknown)
Ec2AvailabilityZone: us-east-1c
Ec2InstanceType: t1.micro
Ec2Kernel: aki-407d9529
Ec2Ramdisk: unavailable
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: cloud-init

Related branches

Revision history for this message
Scott Moser (smoser) wrote :
Scott Moser (smoser)
Changed in cloud-init:
assignee: nobody → Scott Moser (smoser)
importance: Undecided → Medium
status: New → Triaged
Changed in cloud-init (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Scott Moser (smoser) wrote :

Just for the record, the simple work around is to do the following before rebundling:
  sudo rm -f /var/lib/cloud/data/scripts/*

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

fix-released with 0.6.0 and 0.6.0-0ubuntu1

Changed in cloud-init:
status: Triaged → Fix Released
Changed in cloud-init (Ubuntu):
assignee: nobody → Scott Moser (smoser)
status: Triaged → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.