ec2-init overwrites user/vmbuilder provided /etc/apt/sources.list
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init (Ubuntu) |
Fix Released
|
Low
|
Scott Moser | ||
Karmic |
Won't Fix
|
Undecided
|
Unassigned | ||
vm-builder (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
Karmic |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: ec2-init
The ec2-init startup code in /usr/bin/
I support the goal of this code, which is to provide a reasonable default of an apt mirror in the same EC2 region where the instance is running, but the end effect is disastrous for people and tools attempting to create custom /etc/apt.
The (undocumented?) workaround for this problem was for the image builder to place their desired sources.list into the file:
/etc/
However,
a. it is unintuitive and difficult for image builders to know they should do this, and
b. this does not interact well with even the existing image building software like vmbuilder.
Here are some use cases which are hurt by the current policy of always overwriting:
1. User sets the image /etc/apt/
2. User adds multiverse to an EC2 image they are building using vmbuilder's --components option.
3. User adds a PPA to an EC2 image they are building using vmbuilder's --ppa option.
All of the above preferences in the image are currently wiped out by ec2-init when the EC2 instance boots up.
I'd like to see ec2-init be able to detect when the user has customized the /etc/apt/
Further enhancements could then be made to vmbuilder so that its basic --component and --ppa options integrate nicely with the new ec2-init. For example:
1. vmbuilder --component could be smart and modify the /etc/ec2-
2. vmbuilder --ppa could create a file like /etc/apt/
The vmbuilder --mirror option would still create a custom /etc/apt/
ProblemType: Bug
Architecture: i386
Date: Sun Jan 3 00:36:20 2010
DistroRelease: Ubuntu 9.10
Ec2AMI: ami-1515f67c
Ec2AMIManifest: ubuntu-
Ec2Availability
Ec2InstanceType: c1.medium
Ec2Kernel: aki-5f15f636
Ec2Ramdisk: ari-0915f660
Package: ec2-init 0.4.999-0ubuntu7
PackageArchitec
ProcEnviron:
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcVersionSign
SourcePackage: ec2-init
Tags: ec2-images
Uname: Linux 2.6.31-302-ec2 i686
affects: | ec2-init (Ubuntu) → cloud-init (Ubuntu) |
Changed in vm-builder (Ubuntu): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Karmic): | |
status: | New → Won't Fix |
Changed in vm-builder (Ubuntu Karmic): | |
status: | New → Won't Fix |
I've added a 'cloud-config' option to preseve /etc/apt/ sources. list cloud.cfg or in user data tagged as cloud-config. The line is like:
This can be specifed in /etc/cloud/
# Preserve existing /etc/apt/ sources. list sources_ list: true
# Default: overwrite sources_list with mirror. If this is true
# then apt_mirror above will have no effect
apt_preserve_