From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id DE9E97A1AE for ; Thu, 6 May 2021 17:27:37 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D424822D87 for ; Thu, 6 May 2021 17:27:07 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id B86E222D4A for ; Thu, 6 May 2021 17:27:04 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 92C4D4650C for ; Thu, 6 May 2021 17:27:04 +0200 (CEST) From: Stefan Reiter To: pbs-devel@lists.proxmox.com Date: Thu, 6 May 2021 17:26:23 +0200 Message-Id: <20210506152624.12605-9-s.reiter@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210506152624.12605-1-s.reiter@proxmox.com> References: <20210506152624.12605-1-s.reiter@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.014 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH proxmox-backup-restore-image 8/9] kernel: power off on panic X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 May 2021 15:27:37 -0000 Instead of just rebooting, which may lead to an infinite loop, try to resolve the situation by just powering off the VM - it can be restarted any time anyway. Signed-off-by: Stefan Reiter --- ...restore-halt-machine-on-kernel-panic.patch | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/patches/kernel/0004-PBS-restore-halt-machine-on-kernel-panic.patch diff --git a/src/patches/kernel/0004-PBS-restore-halt-machine-on-kernel-panic.patch b/src/patches/kernel/0004-PBS-restore-halt-machine-on-kernel-panic.patch new file mode 100644 index 0000000..d79833f --- /dev/null +++ b/src/patches/kernel/0004-PBS-restore-halt-machine-on-kernel-panic.patch @@ -0,0 +1,32 @@ +From 7222e7424aab957f63b98853ea9fb30eec83666e Mon Sep 17 00:00:00 2001 +From: Stefan Reiter +Date: Mon, 3 May 2021 11:13:10 +0200 +Subject: [PATCH] PBS-restore: halt machine on kernel panic + +Otherwise we might get into a loop where the user-space watchdog never +has time to start, and thus the VM will run forever. Still not an idea +options, since the kernel might hang and not panic, but better than +nothing, and at least solves the out-of-memory forever looping. + +Signed-off-by: Stefan Reiter +--- + kernel/panic.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/kernel/panic.c b/kernel/panic.c +index 332736a72a58..56339ae5165c 100644 +--- a/kernel/panic.c ++++ b/kernel/panic.c +@@ -325,6 +325,9 @@ void panic(const char *fmt, ...) + } + } + if (panic_timeout != 0) { ++ /* PBS restore: stop machine on panic, let host deal with it */ ++ machine_power_off(); ++ + /* + * This will not be a clean reboot, with everything + * shutting down. But if there is a chance of +-- +2.20.1 + -- 2.20.1