MaaS should set /etc/environment with appropriate proxy settings for rescue mode
Bug #1671320 reported by
Mathieu Trudel-Lapierre
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Invalid
|
Wishlist
|
Unassigned | ||
maas (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
A system in rescue mode starts with an essentially empty /etc/environment:
PATH="/
However, some things may require that environment file to be filled in to work properly. For example, snapd will work correctly from the start if http_proxy is set in /etc/environment:
PATH="/
http_proxy=http://
Changed in maas: | |
importance: | Undecided → Wishlist |
Changed in maas (Ubuntu): | |
importance: | Undecided → Wishlist |
Changed in maas: | |
milestone: | none → next |
status: | New → Triaged |
Changed in maas (Ubuntu): | |
status: | New → Triaged |
Changed in maas: | |
milestone: | next → none |
To post a comment you must log in.
"some things may require that environment file to be filled in to work properly"
And some things will require that environment file to *not* be filled in to work properly.
My experience with using http_proxy environment variable is that it is much better to "opt in" for services than to attempt global setting and then "opt out". Global setting via /etc/environment works only for a very small set of systems, that have their entire network connectivity through the proxy.
It falls apart quickly for systems that
a.) are on multiple networks, connected to some networks that the proxy is not connected to. Any requests to systems on those networks will be sent to the proxy and fail.
b.) run services in an lxc container, a vm on the system on a bridge or on localhost.
The simplest example of this is just: your-proxy 127.0.0. 1:9999/
export http_proxy=
python -m SimpleHttpServer 9999
wget http://
That fails, and often in ways that are very difficult to recognize.
Setting http_proxy in a global place on a system is just too unflexible to work reliably. You end up having to use 'no_proxy' and setting it to long lists of IP addresses. GNU tools have nice function like: no_proxy= 10.0.0. 0/24 , but python and many other readers of http_proxy do not support that, so you have to set individual IP addresses, which is just not reasonable.
Over all, its much better for processes that need connectivity to a resource behind a proxy to be configured themselves. Ie, configuring /etc/apt/ apt.conf. d/proxy is better than /etc/environment.