[lxc-devel] [lxd/stable-3.0] forkproxy: Fixes bug where proxy wouldn't start in snap environment

tomponline on Github lxc-bot at linuxcontainers.org
Tue Aug 27 09:15:39 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 360 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190827/e94a542c/attachment.bin>
-------------- next part --------------
From dca7cb81eed2e738bffbc9d38cd07a093ae7049e Mon Sep 17 00:00:00 2001
From: Thomas Parrott <tomp at tomp.uk>
Date: Tue, 27 Aug 2019 10:13:50 +0100
Subject: [PATCH] forkproxy: Fixes bug where proxy wouldn't start in snap
 environment

Fixes #6112

Signed-off-by: Thomas Parrott <tomp at tomp.uk>
---
 lxd/main_forkproxy.go | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lxd/main_forkproxy.go b/lxd/main_forkproxy.go
index ff8b317271..818ab06941 100644
--- a/lxd/main_forkproxy.go
+++ b/lxd/main_forkproxy.go
@@ -311,9 +311,11 @@ func (c *cmdForkproxy) Run(cmd *cobra.Command, args []string) error {
 	lAddr := proxyParseAddr(listenAddr)
 
 	if C.whoami == C.FORKPROXY_CHILD {
-		err := os.Remove(lAddr.addr)
-		if err != nil && !os.IsNotExist(err) {
-			return err
+		if lAddr.connType == "unix" {
+			err := os.Remove(lAddr.addr)
+			if err != nil && !os.IsNotExist(err) {
+				return err
+			}
 		}
 
 		file, err := getListenerFile(listenAddr)


More information about the lxc-devel mailing list