From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 107E71FF12C for ; Wed, 05 Aug 2026 11:09:52 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 883D7217DC; Wed, 05 Aug 2026 11:09:51 +0200 (CEST) From: Maximiliano Sandoval To: pve-devel@lists.proxmox.com Subject: Re: [PATCH proxmox-mini-journalreader 1/2] add -B parameter to lists boots In-Reply-To: <20260805081911.131557-2-m.sandoval@proxmox.com> (Maximiliano Sandoval's message of "Wed, 5 Aug 2026 10:19:09 +0200") References: <20260805081911.131557-1-m.sandoval@proxmox.com> <20260805081911.131557-2-m.sandoval@proxmox.com> User-Agent: mu4e 1.12.9; emacs 30.1 Date: Wed, 05 Aug 2026 11:09:47 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1785920974307 X-SPAM-LEVEL: Spam detection results: 0 AWL -1.014 Adjusted score from AWL reputation of From: address BITCOIN_OBFU_SUBJ 1 Bitcoin + obfuscated subject DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) PDS_BTC_ID 0.498 FP reduced Bitcoin ID PDS_BTC_MSGID 0.947 Bitcoin ID with T_MSGID_NOFQDN2 RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: TS4GGZLFLHFCSOY4B2YDC2UUO6CL7YNS X-Message-ID-Hash: TS4GGZLFLHFCSOY4B2YDC2UUO6CL7YNS X-MailFrom: m.sandoval@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Maximiliano Sandoval writes: > The parameter will print all boots, in practice it should be piped into tail. > > Sample output: > > 2026-07-27 08:28 2026-07-27 15:56 3e3813556d53477f9a139a7cb2f3e8f2 7.0.14-6-pve > 2026-07-27 15:57 2026-07-27 17:03 5a0324e1ac3f4f24907a21ab81b67384 7.0.14-7-pve > 2026-07-28 08:26 2026-07-28 17:07 e62bc71e85274f21a1bfb954be38c071 7.0.14-7-pve > 2026-07-29 08:43 2026-07-29 08:48 7f668e4499644ea1b8339d6b8c29d53d 7.0.14-7-pve > 2026-07-29 08:49 2026-07-29 17:09 9ff5eb6f0485466383e0b89512f937c9 7.0.14-8-pve > > glib is added as a dependency for simplicity of memory management. > > Signed-off-by: Maximiliano Sandoval > --- > > Notes: > We usually require the output from `last` or similar in support to query the > previosly booted kernel versions. We add this helper to avoid adding a > dependency on either last or wtmpdb on the ISO images. > > One awkward thing is that doing sd_journal_seek_tail while inside a > sd_journal_query_unique results in a segmentation fault, hence we iterate twice. > > This seems quick enough for ~400 boots: > > time sudo ./proxmox-mini-journalreader -B | wc -l > 417 > > real 0m0,143s > user 0m0,004s > sys 0m0,004s > > Open questions: > > Should it list the latest boots first? It amounts to reversing the sign on > boot_info_cmp. > > [..] Found a couple of very minor issues, will send a v2 once there is feedback. v2 does not need to open a second journal, but still needs the double iteration. -- Maximiliano