Won't work behind http proxy

Bug #455622 reported by rcludw
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
RootStock
Fix Released
High
Oliver Grawert

Bug Description

So if http_proxy is set before rootstock is run, rootstock doesn't pass this to the qemu image.

This an be done easily by detecting it either by the shell variable or looking in apt.conf, and then
setting it before ${SECOND_STAGE} is run on the qemu image.

I set the proxy manually in the script that runs ${SECOND_STAGE} and that seems to work fine.

Related branches

Revision history for this message
david.luca (david-luca) wrote :

I'm sorry, it's not very clear for me, how can I tell the proxy to qemu image, which shell variable? I tried exporting in rootstock script http_proxy=http://<proxyserver:port>, but still doesn't work... Thanks, David.

Revision history for this message
rcludw (rob-rcludw) wrote : Re: [Bug 455622] Re: Won't work behind http proxy

David,

Apologies. I'm doing this from memory.

There is a shell script that is defined for the qemu session that is
defined in the rootstock main shell script. This classifies the problem
as a shell script running from inside another shell script.

Normally exporting a variable in the outer shell script would work for
any subprocesses run by the shell. But this isn't the normal case.
qemu won't inherit exported variables (which makes sense).

The inner shell script starts around line 798 and looks like this:

cat > $BUILDDIR/installer <<EOF
#!/bin/bash

Put these lines next to the exports that immediately follow:

if [ "${http_proxy}" != "" ]; then
export http_proxy=${http_proxy}
fi

The http_proxy variable will be deref'd by the outer shell script. So
when it runs in the inner shell script it becomes:

if [ "http://proxy:80" != "" ]; then
export http_proxy=http://proxy:80
fi

If http_proxy is unset in the outer scripts, environment, it remains
unset in the inner script.

--Rob

On Mon, 2010-03-01 at 15:43 +0000, david.luca wrote:
> I'm sorry, it's not very clear for me, how can I tell the proxy to qemu
> image, which shell variable? I tried exporting in rootstock script
> http_proxy=http://<proxyserver:port>, but still doesn't work... Thanks,
> David.
>

Oliver Grawert (ogra)
Changed in project-rootstock:
status: New → Fix Committed
assignee: nobody → Oliver Grawert (ogra)
importance: Undecided → High
Changed in project-rootstock:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.