The documentation I have read on systemd unit files states that unit files can be found in three locations on the filesystem:
/etc/systemd/system/
: system unit files/run/systemd/system/
: runtime unit files/lib/systemd/system/
(also sometimes/usr/lib/systemd/system/
): default unit files for packages
I understand that system unit files are for (possibly user-configured) system daemons. I also understand that default package unit files are unit files that come along with package installs that provide sane defaults.
However, I cannot find documentation that explains the purpose of runtime unit files. What are runtime unit files for? Might I, as a sysadmin, ever create one? What are some examples of problems that might be solved with runtime unit files? Why do runtime unit files take precedence over package unit files, but not over system unit files?