On a system with snapshot support
/var should not be part of the
root file system, otherwise doing a rollback to a previous state would
also roll back the /var
contents. On a read-only system this directory has to be writable in any
case, variable data is stored inside.
Due to the volatile nature of
/var the directory will
not be mounted into the new snapshot during the
transactional-update run, as this would
break atomicity: The currently running system depends on the old state
of the data (imagine a database migration was triggered by a package).
Any modifications to /var
therefore have to be in the new system, i.e. modifying the contents of
/var as part of the packaging
scripts is not allowed.
The only exception to this rule are directories: Those will be recreated during the first boot into the updated system by the create-dirs-from-rpmdb.service helper service. For all other cases please use one of the options described in Packaging for transactional-updates and Migration / Upgrade in the Packaging guidelines. If a package is breaking this rule by installing files into a directory which is not part of the root file system, then a warning message indicating the affected file is printed at the end of the transactional-update run.