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

Comments

Projects
None yet
4 participants
@JrCs

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 from Environment avariable http_proxy not honored to Environment variable http_proxy not honored Jan 13, 2016

@mbarnes

This comment has been minimized.

Show comment
Hide comment
@mbarnes

mbarnes Jan 13, 2016

Collaborator

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.

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@cgwalters

cgwalters Jan 13, 2016

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.

Member

cgwalters commented Jan 13, 2016

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

This comment has been minimized.

Show comment
Hide comment
@mbarnes

mbarnes Jan 14, 2016

Collaborator

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.

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@cgwalters

cgwalters Jan 14, 2016

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.

Member

cgwalters commented Jan 14, 2016

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 closed this Jan 14, 2016

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

@anupambasak

This comment has been minimized.

Show comment
Hide comment
@anupambasak

anupambasak 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.

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

This comment has been minimized.

Show comment
Hide comment
@cgwalters

cgwalters Jun 9, 2017

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.

Member

cgwalters commented Jun 9, 2017

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