The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/1892

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
This config file is created when starting a container, but not migrating it
or resuming it or probably some other cases. Instead, let's just always
create it so that we don't have to worry about it existing.

Signed-off-by: Tycho Andersen <tycho.ander...@canonical.com>
From 7b7c4a5d74a571472d814fc57ae849e9f8b0eb48 Mon Sep 17 00:00:00 2001
From: Tycho Andersen <tycho.ander...@canonical.com>
Date: Wed, 13 Apr 2016 11:26:17 -0600
Subject: [PATCH] exec: create config file before referencing it

This config file is created when starting a container, but not migrating it
or resuming it or probably some other cases. Instead, let's just always
create it so that we don't have to worry about it existing.

Signed-off-by: Tycho Andersen <tycho.ander...@canonical.com>
---
 lxd/container_lxc.go | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lxd/container_lxc.go b/lxd/container_lxc.go
index 68b25e1..140d301 100644
--- a/lxd/container_lxc.go
+++ b/lxd/container_lxc.go
@@ -2987,7 +2987,13 @@ func (c *containerLXC) Exec(command []string, env 
map[string]string, stdin *os.F
                envSlice = append(envSlice, fmt.Sprintf("%s=%s", k, v))
        }
 
-       args := []string{c.daemon.execPath, "forkexec", c.name, 
c.daemon.lxcpath, filepath.Join(c.LogPath(), "lxc.conf")}
+       configPath := filepath.Join(c.LogPath(), "lxc.conf")
+       err := c.c.SaveConfigFile(configPath)
+       if err != nil {
+               return -1, err
+       }
+
+       args := []string{c.daemon.execPath, "forkexec", c.name, 
c.daemon.lxcpath, configPath}
 
        args = append(args, "--")
        args = append(args, "env")
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to