Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment variable http_proxy no longer honored (since switch to daemon mode) #208

Closed
JrCs opened this issue Jan 13, 2016 · 6 comments
Closed

Comments

@JrCs
Copy link

JrCs commented Jan 13, 2016

Hi,

i'm using rpm-ostree version 2015.11 (used in fc23 atomic project) and when i try to upgrade the host i have:

bash-4.3# rpm-ostree upgrade
Updating from: fedora-atomic:fedora-atomic/f23/x86_64/docker-host
error: Error resolving 'dl.fedoraproject.org': Name or service not known

so the rpm-ostree didn't use the http_proxy environment variable i have exported just before calling the script.

@JrCs JrCs changed the title Environment avariable http_proxy not honored Environment variable http_proxy not honored Jan 13, 2016
@mbarnes
Copy link
Contributor

mbarnes commented Jan 13, 2016

This is because the rpm-ostree command now talks to a daemon process that does the actual upgrade.

I suppose the client command should pass that over to the daemon, since many users will expect their http_proxy setting to work.

In the meantime you can set a proxy option in the appropriate config file under /etc/ostree/remotes.d. It uses the same format as the http_proxy variable.

@cgwalters
Copy link
Member

PackageKit does the daemon passing now, might look at that.

That said I think the config file solution is what we should push people towards.

@mbarnes
Copy link
Contributor

mbarnes commented Jan 14, 2016

I explored this a bit today. The rpm-ostree changes are easy enough, but proxy settings in libostree are buried pretty deep and can't be overridden externally without public API additions and some internal reworking -- more effort than I think it's worth since the config file solution is preferred (see ostree.repo-config(5)).

Recommend closing unless someone has another suggestion.

@cgwalters
Copy link
Member

Yeah...it's a bit unfortunate in that it used to work. But on the other hand, with the switch to systemd, administrators have got to get used to their shell's environment not propagating into daemons.

So...closing, but without prejudice. If someone came along and wanted to make this work, I'd say we should take a patch.

@cgwalters cgwalters changed the title Environment variable http_proxy not honored Environment variable http_proxy no longer honored (since switch to daemon mode) Jan 14, 2016
@anupambasak
Copy link

anupambasak commented Jun 9, 2017

Here's a way to configure this:

mkdir -p /etc/systemd/system/rpm-ostreed.service.d
cat > /etc/systemd/system/rpm-ostreed.service.d/http-proxy.conf << EOF
[Service]
Environment="http_proxy=http://172.16.1.61:8080"
EOF

(Or on newer systemd versions, you can use systemctl edit rpm-ostreed.service.)

Then do systemctl restart rpm-ostreed.service.

@cgwalters
Copy link
Member

Yep, thank you for documenting that approach! I hope you don't mind but I edited your comment to use Markdown and to be an easily copy-pastable set of commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants