list-profiles: show when each profile was last running - #148
Open
Yury-MonZon wants to merge 1 commit into
Open
Conversation
Yury-MonZon
marked this pull request as ready for review
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
force-pushed
the
list-profiles-last-used
branch
from
July 31, 2026 14:48
e265b90 to
7e8af79
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
list-profilessaid when a profile was created but not whether it had ever been used, which is thequestion you actually have with five bootable roots on one device.
Nothing records that directly, and
@var-logis shared, so the journal cannot tell profiles apart.What is per-profile is systemd's own state:
var/lib/systemd/random-seedis rewritten at every bootand again at clean shutdown, and
var/lib/systemd/timesync/clockis rewritten by timesyncd while theprofile 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.
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:never_stockreadsneveragain, while the copy moved aside keeps its timeDraft because it touches
list-profiles, which #144 and #145 also change. If those land first thisneeds a trivial rebase; if this lands first they get the same one-line conflict on the header
printf.