[lxc-devel] [lxd/master] Don't expire lxd.log by accident
stgraber on Github
lxc-bot at linuxcontainers.org
Mon Oct 29 16:45:37 UTC 2018
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/20181029/efcfc7de/attachment.bin>
-------------- next part --------------
From f97c75e511b8928bbb4deec1ea63cf7f30086b52 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 29 Oct 2018 12:44:48 -0400
Subject: [PATCH] Don't expire lxd.log by accident
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/logging.go | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lxd/logging.go b/lxd/logging.go
index 5f3d1be6c7..0605ebb8f4 100644
--- a/lxd/logging.go
+++ b/lxd/logging.go
@@ -79,6 +79,11 @@ func expireLogs(ctx context.Context, state *state.State) error {
default:
}
+ // We only care about container directories
+ if !entry.IsDir() {
+ continue
+ }
+
// Check if the container still exists
if shared.StringInSlice(entry.Name(), containers) {
// Remove any log file which wasn't modified in the past 48 hours
More information about the lxc-devel
mailing list