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