SYSTEMD-UP...E.SERVICE(8)

๐Ÿ’– systemd-update-done.service, systemd-update-done โ€” marking /etc/ and /var/ as fully updated โœจ

okay bestie, this one's from the systemd-update-done.service manual (section 8, system manager stuff, iykyk) and honestly it's giving "quiet little helper that does one extremely specific thing and does it flawlessly" ๐Ÿ’…


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

systemd-update-done.service

/usr/lib/systemd/systemd-update-done

like. that's it. that's the whole vibe. โœจ


๐ŸŒธ DESCRIPTION ๐ŸŒธ

so systemd-update-done.service is a service that gets invoked as part of the first boot after the vendor operating system resources in /usr/ have been updated. which is lowkey so useful, because it lets you implement offline updates of /usr/ โ€” the kind that might need updates to /etc/ or /var/ on the boot that comes right after ๐Ÿฆ‹

and here's the actual magic trick: systemd-update-done.service updates the file modification time (mtime) that's stored in and "on" the files /etc/.updated and /var/.updated, setting it to the modification time of the /usr/ directory. unless those stamp files are already newer, in which case it justโ€ฆ doesn't. respect. ๐Ÿ™ˆ

tiny nerdy aside, no cap: the timestamp is stored as the mtime field on the file, but also in the file, so that filesystems which don't store full timestamp precision are still supported. the way that's so thoughtful of them ๐Ÿ˜ญ

so if you've got services that should run after offline upgrades of /usr/, you should order them before systemd-update-done.service, and use the ConditionNeedsUpdate= condition (peep systemd.unit(5)) to make sure they run when /etc/ or /var/ are older than /usr/ โ€” according to the modification times of the files we just talked about ๐Ÿ‘‘

โš ๏ธ but heads up: this requires that updates to /usr/ are always followed by an update of the modification time of /usr/, for example by invoking touch(1) on it. every single time. no skipping. periodt.

๐Ÿซถ ALSO. super important. if the systemd.condition_needs_update= kernel command line option is used, it overrides the ConditionNeedsUpdate= unit condition checks. in that case systemd-update-done.service will not reset the condition state until a follow-up reboot happens where that kernel switch is not specified anymore. so like, it stays in that state until you reboot clean. noted. ๐Ÿ’€

โœจ OPTIONS โœจ

these are the options it understands, bestie:

  • --root=root โ€” takes a directory path as an argument, and the program will operate on paths below the specified root directory. ๐Ÿงš

Added in version 258.

  • -h, --help โ€” prints a short help text and exits. classic. ๐ŸŽ€
  • --version โ€” prints a short version string and exits. the little "who am i" moment โญ

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

systemd(1), systemd.unit(5), touch(1) ๐Ÿ’œ


and that's the whole page, bestie!! go forth and let your /etc/ and /var/ know they're fully updated ๐Ÿ’…

๐ŸŒธ this was brought to you by systemd 262.1, page SYSTEMD-UP...E.SERVICE(8) โ€” mwah, stay slaying ๐Ÿซถโœจ

๐Ÿ“ฆ where this page comes from
  • arch rolling: systemd 262.1-1 ยท LGPL-2.1-or-later AND CC0-1.0 AND GPL-2.0-or-later AND MIT-0
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms