Bug 163482 - up2date ignores proxy environment variables when invoked within kickstart %post section
up2date ignores proxy environment variables when invoked within kickstart %po...
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: anaconda (Show other bugs)
4
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Anaconda Maintenance Team
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-07-18 03:42 EDT by Anchor Systems Managed Hosting
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-07-18 15:23:07 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Anchor Systems Managed Hosting 2005-07-18 03:42:19 EDT
I am experiencing the same behaviour under the Fedora Core 4 kickstart %post
environment as the cloned bug below. In addition to setting the http_proxy as an
environment variable with "export http_proxy=http://our.proxy.address:3128/" I
have also attempted to set it as a local variable to up2date by issuing the
command "http_proxy=http://our.proxy.address:3128/ up2date -f -u". Neither
appears to work.

Eventually the up2date times out with the following error:

An error has occurred:
yum.Errors.RepoError
See /var/log/up2date for more information
An error has occurred:
yum.Errors.RepoError
See /var/log/up2date for more information
An error has occurred:
yum.Errors.RepoError
See /var/log/up2date for more information


+++ This bug was initially created as a clone of Bug #140703 +++

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)
Gecko/20040922

Description of problem:
(Disclaimer: I've noticed this problem using the Whitebox RHEL
rebuild, I haven't had chance to confirm it happens with proper RHEL,
I imagine it does)

I have a Squid proxy set up, with a tendency to retain RPMs for
longer, which I use to fetch package updates through, as opposed to
maintaining my own copies of the whole package trees.

As part of my kickstart %post script, I create /etc/profile.d/proxy.*
files containing the *_proxy environment variables so all shells get
set correctly to use the proxy.

Another thing I do within the %post script is to run 'up2date -f -u'
to pull all of the latest updates in, and I ideally want to use the
proxy for this step so prior to that I source the
/etc/profile.d/proxy.sh to set the correct environment variables.

What I found with some of my kickstart installs was that it was
ignoring the proxy completely and downloading directly from each
package repository.

I traced the difference down to some kickstart scripts where I
explicitly ran '/usr/sbin/up2date', these worked, but the ones where I
just ran 'up2date' relying on the $PATH to do the dirty work, these
didn't work.

Using the Alt+F2 terminal within the installer environment I can
replicate this whilst chrooted into /mnt/sysimage with the proxy
environment variables set:

Works: /usr/sbin/up2date or ./up2date with $PWD == /usr/sbin
Doesn't work: up2date

Once I've rebooted to the installation, up2date works correctly on all
invocations, so it seems to be some strange interaction with the
installation environment.

Workaround is to explicitly state the full path to the up2date binary
in the kickstart script.

Version-Release number of selected component (if applicable):
4.1.16

How reproducible:
Always

Steps to Reproduce:
1. Within kickstart %post script, create environment variables
pointing to Squid proxy
2. Run 'up2date -f -u'
3. Examine Squid proxy logs
    

Actual Results:  Logs show no client access from kickstart client.

Expected Results:  Logs should show kickstart client pulling Yum
headers and RPM packages through proxy, (wherever possible).

Additional info:
Comment 1 Jeremy Katz 2005-07-18 15:23:07 EDT
You're probably getting /usr/bin/up2date which uses consolehelper. 
consolehelper cleans the environment to avoid users being able to root the box
by passing "special" environment variables

Note You need to log in before you can comment on or make changes to this bug.