Hi,

On Xenial, I just had to debug an issue where a snap service wasn't getting
the proxy variables set.

i traditionally set these variables in /etc/environment, and that usually
worked.

Some googling led me to
https://bugs.launchpad.net/ubuntu/+source/lxd/+bug/1557161 where a similar
problem was encountered, and the solution/workaround was to suck in
/etc/environment via EnvironmentFile. So that's what I did:

[Service]
...
EnvironmentFile=-/etc/environment
Environment="SNAP=/snap/....  "

Then the service got the proxy variables, and worked.

That file is provided by snappy, however, and not something that the snap
developer controls with that level of detail I believe. Having the
sysadm/user add an override file for just that service is also possible,
but it's a bit more complicated than it should be I think.

Finally, snappy would probably want to be very careful about the shell
variables it imports into a snap.

What would be the best way to make sure a snap gets the proxy variables it
might need to work? Maybe I completely misunderstood how to set a proxy
system-wide in Xenial?

Thanks!
-- 
Snapcraft mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft

Reply via email to