From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: Re: [PATCH proxmox-mini-journalreader 1/2] add -B parameter to lists boots
Date: Wed, 05 Aug 2026 11:09:47 +0200 [thread overview]
Message-ID: <s8oy0elndb8.fsf@toolbox> (raw)
In-Reply-To: <20260805081911.131557-2-m.sandoval@proxmox.com> (Maximiliano Sandoval's message of "Wed, 5 Aug 2026 10:19:09 +0200")
Maximiliano Sandoval <m.sandoval@proxmox.com> 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 <m.sandoval@proxmox.com>
> ---
>
> 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
next prev parent reply other threads:[~2026-08-05 9:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 8:19 [PATCH manager/proxmox-mini-journalreader 0/2] report: list recent reboot events and their kernel version Maximiliano Sandoval
2026-08-05 8:19 ` [PATCH proxmox-mini-journalreader 1/2] add -B parameter to lists boots Maximiliano Sandoval
2026-08-05 9:09 ` Maximiliano Sandoval [this message]
2026-08-05 8:19 ` [PATCH manager 2/2] report: list recent reboot events and their kernel version Maximiliano Sandoval
2026-08-05 9:50 ` superseded: [PATCH manager/proxmox-mini-journalreader 0/2] " Maximiliano Sandoval
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s8oy0elndb8.fsf@toolbox \
--to=m.sandoval@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.