MaaS should set /etc/environment with appropriate proxy settings for rescue mode

Bug #1671320 reported by Mathieu Trudel-Lapierre
8
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="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"

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="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
http_proxy=http://192.168.254.254:8000/

Revision history for this message
Scott Moser (smoser) wrote :

"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:
 export http_proxy=your-proxy
 python -m SimpleHttpServer 9999
 wget http://127.0.0.1:9999/

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.

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
Revision history for this message
Adam Collard (adam-collard) wrote :

This bug has not seen any activity in the last 6 months, so it is being automatically closed.

If you are still experiencing this issue, please feel free to re-open.

MAAS Team

Changed in maas:
status: Triaged → Invalid
Changed in maas:
milestone: next → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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