From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 0E6151FF16F for ; Tue, 8 Jul 2025 18:43:18 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D615A1BE9E; Tue, 8 Jul 2025 18:44:00 +0200 (CEST) From: Friedrich Weber To: pve-devel@lists.proxmox.com Date: Tue, 8 Jul 2025 18:43:44 +0200 Message-ID: <20250708164344.104855-1-f.weber@proxmox.com> X-Mailer: git-send-email 2.47.2 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.140 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH ifupdown2] debian: postinst: ensure /etc/iproute2/rt_tables.d exists X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" When upgrading to Debian Trixie, iproute2 is also upgraded. Its postinst deletes /etc/iproute2/rt_tables.d if it is currently empty (or only contains a README file) [1]. After that, ifreload -a will always print a warning: > error: [Errno 2] No such file or directory: '/etc/iproute2/rt_tables.d/ifupdown2_vrf_map.conf' because it cannot create the file if the parent directory does not exist. To avoid that, create the directory in ifupdown2's postinst if it does not exist yet. Commit b115f7f ("add /etc/iproute2/rt_tables.d/ to managed directories") already added the directory to ifupdown2.dirs, but this does not seem to be effective, due to the following sequence of events on upgrade: 1) iproute2 is unpacked 2) ifupdown2 is unpacked. The directory still exists, so the ifupdown2.dirs entry does not have an effect 3) ifroute2 is set up, and its postinst empties and removes the directory 4) ifupdown2 is set up [1] https://sources.debian.org/src/iproute2/6.15.0-1/debian/iproute2.postinst/ Signed-off-by: Friedrich Weber --- Notes: Please check the reasoning for plausibility, my understanding of dpkg is very basic, this is just what I could infer from running strace on the upgrade. An alternative solution would be to patch ifupdown2 itself to create the directory (if needed) before trying to write to the ifupdown2_vrf_map.conf file. debian/ifupdown2.postinst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/ifupdown2.postinst b/debian/ifupdown2.postinst index f9a719c..13cc987 100644 --- a/debian/ifupdown2.postinst +++ b/debian/ifupdown2.postinst @@ -111,6 +111,9 @@ case "$1" in process_udev chmod +x /usr/share/ifupdown2/__main__.py postinst_remove_diverts + if [ ! -d /etc/iproute2/rt_tables.d ]; then + mkdir /etc/iproute2/rt_tables.d || echo "could not create /etc/iproute2/rt_tables.d" + fi if [ -z "$2" ] && [ ! -e /proxmox_install_mode ]; then proxmox_compatibility echo "Reloading network config on first install" -- 2.47.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel