On Thu, Aug 03, 2006 at 01:44:57PM +0100, Thomas Stewart wrote:
> Subject: xen-tools: xen-create-image never finishes when behind a http proxy
> Package: xen-tools
> Version: 2.2-3
> Severity: important
>
> /usr/lib/xen-tools/debian.d/20-setup-apt creates a
> canned /etc/apt/sources.list with 4 repo lines. The first 2 are
> ${mirror} which in my case I set in /etc/xen-tools/xen-tools.conf to a
> local apt-cacher that knows about the http proxy. However the last 2
> repo lines are security.debian.org ones. Later 20-setup-apt runs apt-get
> update. As the box can't connect directly to the Internet the process
> just sits there timing out.
Right that sounds like a bug.
> When the setup scripts were in /etc/xen-tools/hooks.d, I created a
> 19-setup-apt-proxy that created /etc/apt/apt.conf.d/10proxy:
> Acquire::http::Proxy "http://wwwcache:3128"
> This meant that apt knew about the proxy, which worked fine.
Good solution :)
> I considered using /etc/xen-tools/skel instead, but skel is not copied
> till 65-copy-user-files is run.
True.
> I suggest either a more configurable 20-setup-apt, so that I can change
> the security.debian.org lines to point at my apt-casher. Or implement a
> 19-setup-apt-proxy. Or have I missed the obvious way to do custom
> modifications/overrides for /usr/lib/xen-tools/debian.d?
I think that the real solution is to see if there is a proxy in
use on the host, and if so create the identical proxy in the new
guest.
That seems like it would satisfy your goal whilst still being
understandable. (Alternatively testing for "${http_proxy}" might
work.)
So I'd suggest that the setup apt script was prefixed with this:
--
#
# Process any of the present apt-conf setup lines.
#
for i in /etc/apt/apt.conf /etc/apt/apt.conf.d/* ; do
#
# If the file exists. (Need this in case the literal glob fails.)
#
if [ -e $i ] ; then
#
# Save the matching line(s) to the proxy guess file.
#
grep -i HTTP::Proxy $i >> ${prefix}/etc/apt/apt.conf.d/proxy-guess
fi
done
--
Does that seem reasonable? And if so would you mind testing it?
Steve
--
http://www.steve.org.uk/
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]