Merge lp:~ubuntu-branches/ubuntu/oneiric/lxc/oneiric-201109152108 into lp:ubuntu/oneiric/lxc

Proposed by Ubuntu Package Importer
Status: Rejected
Rejected by: James Westby
Proposed branch: lp:~ubuntu-branches/ubuntu/oneiric/lxc/oneiric-201109152108
Merge into: lp:ubuntu/oneiric/lxc
Diff against target: 255 lines (+239/-0) (has conflicts)
2 files modified
.pc/0007-fix-lxc-clone-hostname.patch/src/lxc/lxc-clone.in (+208/-0)
debian/patches/0007-fix-lxc-clone-hostname.patch (+31/-0)
Conflict adding file .pc/0007-fix-lxc-clone-hostname.patch.  Moved existing file to .pc/0007-fix-lxc-clone-hostname.patch.moved.
Conflict adding file debian/patches/0007-fix-lxc-clone-hostname.patch.  Moved existing file to debian/patches/0007-fix-lxc-clone-hostname.patch.moved.
To merge this branch: bzr merge lp:~ubuntu-branches/ubuntu/oneiric/lxc/oneiric-201109152108
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+75640@code.launchpad.net

Description of the change

The package importer has detected a possible inconsistency between the package history in the archve and the history in bzr. As the archive is authoritative the importer has made lp:ubuntu/oneiric/lxc reflect what is in the archive and the old bzr branch has been pushed to lp:~ubuntu-branches/ubuntu/oneiric/lxc/oneiric-201109152108. This merge proposal was created so that an Ubuntu developer can review the situations and perform a merge/upload if necessary. There are three typical cases where this can happen.
  1. Where someone pushes a change to bzr and someone else uploads the package without that change. This is the reason that this check is done by the importer. If this appears to be the case then a merge/upload should be done if the changes that were in bzr are still desirable.
  2. The importer incorrectly detected the above situation when someone made a change in bzr and then uploaded it.
  3. The importer incorrectly detected the above situation when someone just uploaded a package and didn't touch bzr.

If this case doesn't appear to be the first situation then set the status of the merge proposal to "Rejected" and help avoid the problem in future by filing a bug at https://bugs.launchpad.net/udd linking to this merge proposal.

(this is an automatically generated message)

To post a comment you must log in.

Unmerged revisions

37. By Chuck Short

* debian/patches/0007-fix-lxc-clone-hostname.patch: make sure $hostname
  is defined before it is first used. Reported by Benjamin Saller.
  (LP: #850205)
* add missing ; at end of 'send hostname' in dhclient.conf (LP: #851274)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory '.pc/0007-fix-lxc-clone-hostname.patch'
2=== renamed directory '.pc/0007-fix-lxc-clone-hostname.patch' => '.pc/0007-fix-lxc-clone-hostname.patch.moved'
3=== added file '.pc/0007-fix-lxc-clone-hostname.patch/.timestamp'
4=== added directory '.pc/0007-fix-lxc-clone-hostname.patch/src'
5=== added directory '.pc/0007-fix-lxc-clone-hostname.patch/src/lxc'
6=== added file '.pc/0007-fix-lxc-clone-hostname.patch/src/lxc/lxc-clone.in'
7--- .pc/0007-fix-lxc-clone-hostname.patch/src/lxc/lxc-clone.in 1970-01-01 00:00:00 +0000
8+++ .pc/0007-fix-lxc-clone-hostname.patch/src/lxc/lxc-clone.in 2011-09-15 21:13:31 +0000
9@@ -0,0 +1,208 @@
10+#!/bin/bash
11+
12+#
13+# lxc: linux Container library
14+
15+# Authors:
16+# Serge Hallyn <serge.hallyn@ubuntu.com>
17+# Daniel Lezcano <daniel.lezcano@free.fr>
18+
19+# This library is free software; you can redistribute it and/or
20+# modify it under the terms of the GNU Lesser General Public
21+# License as published by the Free Software Foundation; either
22+# version 2.1 of the License, or (at your option) any later version.
23+
24+# This library is distributed in the hope that it will be useful,
25+# but WITHOUT ANY WARRANTY; without even the implied warranty of
26+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27+# Lesser General Public License for more details.
28+
29+# You should have received a copy of the GNU Lesser General Public
30+# License along with this library; if not, write to the Free Software
31+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32+
33+usage() {
34+ echo "usage: lxc-clone -o <orig> -n <new> [-s] [-h] [-L fssize] [-v vgname]"
35+}
36+
37+help() {
38+ usage
39+ echo
40+ echo "creates a lxc system object."
41+ echo
42+ echo "Options:"
43+ echo "orig : name of the original container"
44+ echo "new : name of the new container"
45+ echo "-s : make the new rootfs a snapshot of the original"
46+ echo "fssize : size if creating a new fs. By default, 2G"
47+ echo "vgname : lvm volume group name, lxc by default"
48+}
49+
50+shortoptions='ho:n:sL:v:'
51+longoptions='help,orig:,name:,snapshot,fssize,vgname'
52+lxc_path=/var/lib/lxc
53+bindir=/usr/bin
54+snapshot=no
55+lxc_size=2G
56+lxc_vg=lxc
57+
58+getopt=$(getopt -o $shortoptions --longoptions $longoptions -- "$@")
59+if [ $? != 0 ]; then
60+ usage
61+ exit 1;
62+fi
63+
64+eval set -- "$getopt"
65+
66+while true; do
67+ case "$1" in
68+ -h|--help)
69+ help
70+ exit 1
71+ ;;
72+ -s|--snapshot)
73+ shift
74+ snapshot=yes
75+ ;;
76+ -o|--orig)
77+ shift
78+ lxc_orig=$1
79+ shift
80+ ;;
81+ -L|--fssize)
82+ shift
83+ lxc_size=$1
84+ shift
85+ ;;
86+ -v|--vgname)
87+ shift
88+ lxc_vg=$1
89+ shift
90+ ;;
91+ -n|--new)
92+ shift
93+ lxc_new=$1
94+ shift
95+ ;;
96+ --)
97+ shift
98+ break;;
99+ *)
100+ echo $1
101+ usage
102+ exit 1
103+ ;;
104+ esac
105+done
106+
107+if [ -z "$lxc_path" ]; then
108+ echo "no configuration path defined !"
109+ exit 1
110+fi
111+
112+if [ ! -r $lxc_path ]; then
113+ echo "configuration path '$lxc_path' not found"
114+ exit 1
115+fi
116+
117+if [ -z "$lxc_orig" ]; then
118+ echo "no original container name specified"
119+ usage
120+ exit 1
121+fi
122+
123+if [ -z "$lxc_new" ]; then
124+ echo "no new container name specified"
125+ usage
126+ exit 1
127+fi
128+
129+if [ "$(id -u)" != "0" ]; then
130+ echo "This command has to be run as root"
131+ exit 1
132+fi
133+
134+if [ ! -r $lxc_path ]; then
135+ echo "no configuration path defined !"
136+ exit 1
137+fi
138+
139+if [ ! -d "$lxc_path/$lxc_orig" ]; then
140+ echo "'$lxc_orig' does not exist"
141+ exit 1
142+fi
143+
144+if [ -d "$lxc_path/$lxc_new" ]; then
145+ echo "'$lxc_new' already exists"
146+ exit 1
147+fi
148+
149+trap "${bindir}/lxc-destroy -n $lxc_new; echo aborted; exit 1" SIGHUP SIGINT SIGTERM
150+
151+mkdir -p $lxc_path/$lxc_new
152+
153+echo "Tweaking configuration"
154+cp $lxc_path/$lxc_orig/config $lxc_path/$lxc_new/config
155+sed -i '/lxc.utsname/d' $lxc_path/$lxc_new/config
156+echo "lxc.utsname = $hostname" >> $lxc_path/$lxc_new/config
157+
158+sed -i '/lxc.mount/d' $lxc_path/$lxc_new/config
159+echo "lxc.mount = $lxc_path/$lxc_new/fstab" >> $lxc_path/$lxc_new/config
160+
161+cp $lxc_path/$lxc_orig/fstab $lxc_path/$lxc_new/fstab
162+sed -i "s@$lxc_path/$lxc_orig@$lxc_path/$lxc_new@" $lxc_path/$lxc_new/fstab
163+
164+echo "Copying rootfs..."
165+rootfs=$lxc_path/$lxc_new/rootfs
166+# First figure out if the old is a device. For now we only support
167+# lvm devices.
168+mounted=0
169+sed -i '/lxc.rootfs/d' $lxc_path/$lxc_new/config
170+oldroot=`grep lxc.rootfs $lxc_path/$lxc_orig/config | awk -F= '{ print $2 '}`
171+if [ -b $oldroot ]; then
172+ # this is a device. If we don't want to snapshot, then mkfs, mount
173+ # and rsync. Trivial but not yet implemented
174+ if [ $snapshot == "no" ]; then
175+ echo "non-snapshot and non-lvm clone of block device not yet implemented"
176+ exit 1
177+ fi
178+ lvdisplay $oldroot > /dev/null 2>&1
179+ if [ $? -ne 0 ]; then
180+ echo "non-snapshot and non-lvm clone of block device not yet implemented"
181+ exit 1
182+ fi
183+ # ok, create a snapshot of the lvm device
184+ lvcreate -s -L $lxc_size -n $lxc_new /dev/$lxc_vg/$lxc_orig || exit 1
185+ echo "lxc.rootfs = /dev/$lxc_vg/$lxc_new" >> $lxc_path/$lxc_new/config
186+ # and mount it so we can tweak it
187+ mkdir -p $lxc_path/$lxc_new/rootfs
188+ mount /dev/$lxc_vg/$lxc_new $rootfs || { echo "failed to mount new rootfs"; exit 1; }
189+ mounted=1
190+else
191+ cp -a $lxc_path/$lxc_orig/rootfs $lxc_path/$lxc_new/rootfs || return 1
192+ echo "lxc.rootfs = $rootfs" >> $lxc_path/$lxc_new/config
193+fi
194+
195+echo "Updating rootfs..."
196+hostname=$lxc_new
197+
198+# so you can 'ssh $hostname.' or 'ssh $hostname.local'
199+if [ -f $rootfs/etc/dhcp/dhclient.conf ]; then
200+ sed -i "s/send host-name.*$/send host-name $hostname/" $rootfs/etc/dhcp/dhclient.conf
201+fi
202+
203+# set the hostname
204+cat <<EOF > $rootfs/etc/hostname
205+$hostname
206+EOF
207+# set minimal hosts
208+cat <<EOF > $rootfs/etc/hosts
209+127.0.0.1 localhost $hostname
210+EOF
211+
212+# if this was a block device, then umount it now
213+if [ $mounted -eq 1 ]; then
214+ umount $rootfs
215+fi
216+
217+echo "'$lxc_new' created"
218
219=== added file 'debian/patches/0007-fix-lxc-clone-hostname.patch'
220--- debian/patches/0007-fix-lxc-clone-hostname.patch 1970-01-01 00:00:00 +0000
221+++ debian/patches/0007-fix-lxc-clone-hostname.patch 2011-09-15 21:13:31 +0000
222@@ -0,0 +1,31 @@
223+Description: Define $hostname before its first use
224+Author: Serge Hallyn <serge.hallyn@ubuntu.com>
225+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/850205
226+Forwarded: yes
227+
228+Index: f2/src/lxc/lxc-clone.in
229+===================================================================
230+--- f2.orig/src/lxc/lxc-clone.in 2011-09-15 15:33:15.981615000 -0500
231++++ f2/src/lxc/lxc-clone.in 2011-09-15 15:33:39.262824554 -0500
232+@@ -137,6 +137,8 @@
233+ exit 1
234+ fi
235+
236++hostname=$lxc_new
237++
238+ trap "${bindir}/lxc-destroy -n $lxc_new; echo aborted; exit 1" SIGHUP SIGINT SIGTERM
239+
240+ mkdir -p $lxc_path/$lxc_new
241+@@ -184,11 +186,10 @@
242+ fi
243+
244+ echo "Updating rootfs..."
245+-hostname=$lxc_new
246+
247+ # so you can 'ssh $hostname.' or 'ssh $hostname.local'
248+ if [ -f $rootfs/etc/dhcp/dhclient.conf ]; then
249+- sed -i "s/send host-name.*$/send host-name $hostname/" $rootfs/etc/dhcp/dhclient.conf
250++ sed -i "s/send host-name.*$/send host-name $hostname;/" $rootfs/etc/dhcp/dhclient.conf
251+ fi
252+
253+ # set the hostname
254
255=== renamed file 'debian/patches/0007-fix-lxc-clone-hostname.patch' => 'debian/patches/0007-fix-lxc-clone-hostname.patch.moved'

Subscribers

People subscribed via source and target branches

to all changes: