[lxc-devel] [lxd/master] lxd-agent: Don't allow connections when rebooting

stgraber on Github lxc-bot at linuxcontainers.org
Thu Nov 12 14:50:20 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 370 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20201112/253899d2/attachment.bin>
-------------- next part --------------
From 64b228ac675f3a6d13e17484ffb8dba7a6fb0327 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 12 Nov 2020 09:49:52 -0500
Subject: [PATCH] lxd-agent: Don't allow connections when rebooting
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #8148

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd-agent/main_agent.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lxd-agent/main_agent.go b/lxd-agent/main_agent.go
index f9939b5720..4d826813aa 100644
--- a/lxd-agent/main_agent.go
+++ b/lxd-agent/main_agent.go
@@ -99,6 +99,9 @@ func (c *cmdAgent) Run(cmd *cobra.Command, args []string) error {
 		}
 
 		shared.RunCommand("systemctl", "reboot")
+
+		// Wait up to 5min for the reboot to actually happen, if it doesn't, then move on to allowing connections.
+		time.Sleep(300 * time.Second)
 	}
 
 	// Mount shares from host.


More information about the lxc-devel mailing list