[lxc-devel] [lxd/master] lxd-agent: Put /snap/bin in PATH
stgraber on Github
lxc-bot at linuxcontainers.org
Mon Nov 25 18:42:03 UTC 2019
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20191125/b7f2627a/attachment.bin>
-------------- next part --------------
From 1ef3b26abdd8320dc64b96affefbd73ca56b46b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 25 Nov 2019 13:41:44 -0500
Subject: [PATCH] lxd-agent: Put /snap/bin in PATH
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
lxd-agent/exec.go | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lxd-agent/exec.go b/lxd-agent/exec.go
index 3ec7e0ffe9..2908882d2f 100644
--- a/lxd-agent/exec.go
+++ b/lxd-agent/exec.go
@@ -56,6 +56,10 @@ func execPost(d *Daemon, r *http.Request) response.Response {
env["PATH"] = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
}
+ if shared.PathExists("/snap/bin") {
+ env["PATH"] = fmt.Sprintf("%s:/snap/bin", env["PATH"])
+ }
+
// If running as root, set some env variables
if post.User == 0 {
// Set default value for HOME
More information about the lxc-devel
mailing list