chiark / gitweb /
update-done: add minimal tool to manage system updates for /etc and /var, if /usr...
authorLennart Poettering <lennart@poettering.net>
Fri, 13 Jun 2014 10:43:49 +0000 (12:43 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 13 Jun 2014 11:26:32 +0000 (13:26 +0200)
commit8ea48dfcd33e8db0c01bf8c57c3bbcfdc3c86d4b
tree474a196fe6cea93499ede05e35af8ba6ae526a65
parentdc92e62c6c34f242aa54aa187e50a94ed7695c51
update-done: add minimal tool to manage system updates for /etc and /var, if /usr has changed

In order to support offline updates to /usr, we need to be able to run
certain tasks on next boot-up to bring /etc and /var in line with the
updated /usr. Hence, let's devise a mechanism how we can detect whether
/etc or /var are not up-to-date with /usr anymore: we keep "touch
files" in /etc/.updated and /var/.updated that are mtime-compared with
/usr. This means:

Whenever the vendor OS tree in /usr is updated, and any services that
shall be executed at next boot shall be triggered, it is sufficient to
update the mtime of /usr itself. At next boot, if /etc/.updated and/or
/var/.updated is older than than /usr (or missing), we know we have to
run the update tools once. After that is completed we need to update the
mtime of these files to the one of /usr, to keep track that we made the
necessary updates, and won't repeat them on next reboot.

A subsequent commit adds a new ConditionNeedsUpdate= condition that
allows checking on boot whether /etc or /var are outdated and need
updating.

This is an early step to allow booting up with an empty /etc, with
automatic rebuilding of the necessary cache files or user databases
therein, as well as supporting later updates of /usr that then propagate
to /etc and /var again.
.gitignore
Makefile.am
src/update-done/Makefile [new symlink]
src/update-done/update-done.c [new file with mode: 0644]
units/.gitignore
units/systemd-update-done.service.in [new file with mode: 0644]