Skip to content

list-profiles: show when each profile was last running - #148

Open
Yury-MonZon wants to merge 1 commit into
devfrom
list-profiles-last-used
Open

list-profiles: show when each profile was last running#148
Yury-MonZon wants to merge 1 commit into
devfrom
list-profiles-last-used

Conversation

@Yury-MonZon

Copy link
Copy Markdown
Contributor

list-profiles said when a profile was created but not whether it had ever been used, which is the
question you actually have with five bootable roots on one device.

Nothing records that directly, and @var-log is shared, so the journal cannot tell profiles apart.
What is per-profile is systemd's own state: var/lib/systemd/random-seed is rewritten at every boot
and again at clean shutdown, and var/lib/systemd/timesync/clock is rewritten by timesyncd while the
profile runs. The newest of the two is when that profile was last alive.

Existence alone is not the test. A profile inherits both files from whatever it was made from, so a
clone of a used profile, or an image whose build happened to create them, would otherwise report the
ancestor's time as if this profile had run. Only a stamp newer than the profile's own creation counts;
anything older reads never.

Accuracy, stated plainly rather than implied: exact for a cleanly shut down profile, within
timesyncd's poll interval for one that was cut off, and never worse than its boot time. It says the
profile was RUNNING, not that a person used it, which is what the header comment says so it cannot be
read as a login time.

NAME                      KIND     ID   CREATED              LAST USED            RO  PARENT
@Desktop                  profile  265  2026-07-29 10:08:34  2026-07-31 12:43:35  rw  @Desktop_777_stock (264)
@MigDst                   profile  305  2026-07-31 12:57:48  never                rw  @Desktop_778_stock (300)
@Minimal                  profile  263  2026-07-29 10:06:10  2026-07-31 12:45:40  rw  @Minimal_777_stock (262)
@Router                   profile  269  2026-07-29 10:08:55  never                rw  @Router_777_stock (268)

Verified on 192.168.1.110 across three profiles that were actually booted (Desktop, Minimal, then the
migrated profile) and from a third OS, the SD-card Installer, reading the unmounted eMMC through -d:

  • the booted profile tracks the current time, profiles never booted read never
  • a stamp planted before a profile existed is ignored; one planted after it is shown
  • a profile replaced from its _stock reads never again, while the copy moved aside keeps its time
  • the existing 73-check suite still passes, so no assertion shifted from the added column

Draft because it touches list-profiles, which #144 and #145 also change. If those land first this
needs a trivial rebase; if this lands first they get the same one-line conflict on the header printf.

@Yury-MonZon
Yury-MonZon marked this pull request as ready for review July 31, 2026 14:47
@Yury-MonZon
Yury-MonZon requested a review from a team July 31, 2026 14:47
CREATED said nothing about whether a profile had ever been used. systemd rewrites
var/lib/systemd/random-seed at boot and at clean shutdown, and timesyncd rewrites
var/lib/systemd/timesync/clock while the profile runs; the newest of the two is when it was
last alive.

Existence is not enough: a profile inherits both files from whatever it was made from, so only
a stamp newer than the profile's own creation counts. Anything older reads 'never'.
@Yury-MonZon
Yury-MonZon force-pushed the list-profiles-last-used branch from e265b90 to 7e8af79 Compare July 31, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant