[lxc-devel] [lxd/master] Bugfixes

stgraber on Github lxc-bot at linuxcontainers.org
Sat Jul 1 04:42:20 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 301 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170701/1230b926/attachment.bin>
-------------- next part --------------
From 9556c8ef8e3069ba9e015bc7319300ac88241ebe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sat, 1 Jul 2017 00:38:51 -0400
Subject: [PATCH] network: Don't fail on non-process PIDs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

If the PID we have point to a kernel thread, /proc/PID/exe will not
exist and resolving the symlink will therefore fail.

In such cases, just go ahead with an empty path which will result in the
right behavior.

Launchpad: https://bugs.launchpad.net/ubuntu/+source/lxd/+bug/1698712
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/networks_utils.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/networks_utils.go b/lxd/networks_utils.go
index 3bac33d0a..098487cc3 100644
--- a/lxd/networks_utils.go
+++ b/lxd/networks_utils.go
@@ -681,7 +681,7 @@ func networkKillDnsmasq(name string, reload bool) error {
 	// Check if it's dnsmasq
 	cmdPath, err := os.Readlink(fmt.Sprintf("/proc/%s/exe", pid))
 	if err != nil {
-		return err
+		cmdPath = ""
 	}
 
 	// Deal with deleted paths


More information about the lxc-devel mailing list