[lxc-devel] [lxd/master] Have ActiveIfNeeded trigger if we have running containers
stgraber on Github
lxc-bot at linuxcontainers.org
Wed Apr 6 17:03:34 UTC 2016
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/20160406/e8aefd6e/attachment.bin>
-------------- next part --------------
From 362906682d3551a0d1a727081cab708627bea904 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Wed, 6 Apr 2016 13:02:57 -0400
Subject: [PATCH] Have ActiveIfNeeded trigger if we have running containers
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/main.go | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lxd/main.go b/lxd/main.go
index ca1245c..2983efb 100644
--- a/lxd/main.go
+++ b/lxd/main.go
@@ -505,6 +505,10 @@ func cmdActivateIfNeeded() error {
lastState := config["volatile.last_state.power"]
autoStart := config["boot.autostart"]
+ if c.IsRunning() {
+ shared.Debugf("Daemon has running containers, activating...")
+ }
+
if lastState == "RUNNING" || lastState == "Running" || autoStart == "true" {
shared.Debugf("Daemon has auto-started containers, activating...")
_, err := lxd.NewClient(&lxd.DefaultConfig, "local")
More information about the lxc-devel
mailing list