diff -Nru cloud-init-0.7.0~bzr644/debian/changelog cloud-init-0.7.0~bzr644/debian/changelog --- cloud-init-0.7.0~bzr644/debian/changelog 2012-09-02 00:11:36.000000000 +0000 +++ cloud-init-0.7.0~bzr644/debian/changelog 2012-09-13 18:03:49.000000000 +0000 @@ -1,3 +1,10 @@ +cloud-init (0.7.0~bzr644-0ubuntu2~ppa0) quantal; urgency=low + + * remove 'start networking' from cloud-init-nonet, and add + cloud-init-container upstart job (LP: #1031065) + + -- Scott Moser Thu, 13 Sep 2012 14:03:14 -0400 + cloud-init (0.7.0~bzr644-0ubuntu1) quantal; urgency=low * New upstream snapshot. diff -Nru cloud-init-0.7.0~bzr644/debian/patches/lp-1031065.diff cloud-init-0.7.0~bzr644/debian/patches/lp-1031065.diff --- cloud-init-0.7.0~bzr644/debian/patches/lp-1031065.diff 1970-01-01 00:00:00.000000000 +0000 +++ cloud-init-0.7.0~bzr644/debian/patches/lp-1031065.diff 2012-09-13 18:06:20.000000000 +0000 @@ -0,0 +1,74 @@ +------------------------------------------------------------ +revno: 647 +fixes bug: https://launchpad.net/bugs/1031065 +committer: Scott Moser +branch nick: trunk.1031065 +timestamp: Thu 2012-09-13 14:01:04 -0400 +message: + add cloud-init-container.conf + + This changes the way that we avoid cloud-init-nonet hanging in a container. + Previously, under LP: #800824 we tried 'start networking', but that caused + issues described in LP: #1031065. + + Here, we emit the net-device-added for any devices that have not yet been + seen. +diff: +=== added file 'upstart/cloud-init-container.conf' +--- a/upstart/cloud-init-container.conf 1970-01-01 00:00:00 +0000 ++++ b/upstart/cloud-init-container.conf 2012-09-13 18:01:04 +0000 +@@ -0,0 +1,41 @@ ++# in a lxc container, events for network interfaces do not ++# get created or may be missed. This helps cloud-init-nonet along ++# by emitting those events if they have not been emitted. ++ ++start on container ++stop on static-network-up ++task ++ ++emits net-device-added ++ ++console output ++ ++script ++ # if we are inside a container, then we may have to emit the ifup ++ # events for 'auto' network devices. ++ set -f ++ ++ # from /etc/network/if-up.d/upstart ++ MARK_DEV_PREFIX="/run/network/ifup." ++ MARK_STATIC_NETWORK_EMITTED="/run/network/static-network-up-emitted" ++ # if the all static network interfaces are already up, nothing to do ++ [ -f "$MARK_STATIC_NETWORK_EMITTED" ] && exit 0 ++ ++ # get list of all 'auto' interfaces. if there are none, nothing to do. ++ auto_list=$(ifquery --list --allow auto 2>/dev/null) || : ++ [ -z "$auto_list" ] && exit 0 ++ set -- ${auto_list} ++ [ "$*" = "lo" ] && exit 0 ++ ++ to_emit="" ++ for iface in "$@"; do ++ [ "$iface" = "lo" ] && continue ++ # skip interfaces that are already up ++ [ -f "${MARK_DEV_PREFIX}${iface}" ] && continue ++ initctl emit --no-wait net-device-added "INTERFACE=$iface" && ++ emitted="${emitted} ${iface}" || : ++ done ++ ++ [ -z "${emitted# }" ] || ++ echo "${UPSTART_JOB}: emitted ifup for ${emitted# }" ++end script + +=== modified file 'upstart/cloud-init-nonet.conf' +--- a/upstart/cloud-init-nonet.conf 2011-09-29 00:16:05 +0000 ++++ b/upstart/cloud-init-nonet.conf 2012-09-13 18:01:04 +0000 +@@ -18,8 +18,6 @@ + + [ -f /var/lib/cloud/instance/obj.pkl ] && exit 0 + +- start networking >/dev/null +- + short=10; long=120; + sleep ${short} + echo $UPSTART_JOB "waiting ${long} seconds for a network device." diff -Nru cloud-init-0.7.0~bzr644/debian/patches/series cloud-init-0.7.0~bzr644/debian/patches/series --- cloud-init-0.7.0~bzr644/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ cloud-init-0.7.0~bzr644/debian/patches/series 2012-09-13 18:06:33.000000000 +0000 @@ -0,0 +1 @@ +lp-1031065.diff