| |
@@ -4,7 +4,7 @@
|
| |
|
| |
== tmpfiles.d configuration
|
| |
|
| |
- Asking the tmpfiles.d mechanism to create directories for you just involves dropping a file into `+%{_tmpfilesdir}+`. You will need a build dependency on systemd-rpm-macros in order to make use of this macro.
|
| |
+ Asking the tmpfiles.d mechanism to create directories for you just involves dropping a file into `+%{_tmpfilesdir}+`. You will need a build dependency on systemd-rpm-macros in order to make use of this macro, and a runtime dependency on systemd to provide the `+%{_tmpfilesdir}+` directory itself.
|
| |
|
| |
For example, if the package needs a few directories to be created in `+/run+` in order for it to run, the packager needs to create a file named `+%{name}.conf+` that is installed as `+%{_tmpfilesdir}/%{name}.conf+`. The file has one or more lines of the following format:
|
| |
|
| |
@@ -31,12 +31,15 @@
|
| |
|
| |
== Example spec file
|
| |
|
| |
- In the spec file, the packager needs to install the tmpfiles.d conf file into the `+%{_tmpfilesdir}+` directory and also make sure the directory is included in the rpm.
|
| |
+ In the spec file, the packager needs to install the tmpfiles.d conf file into the `+%{_tmpfilesdir}+` directory and also make sure that the rpm depends on the owner of the directory.
|
| |
|
| |
....
|
| |
# For the _tmpfilesdir macro.
|
| |
BuildRequires: systemd-rpm-macros
|
| |
|
| |
+ # To own _tmpfilesdir directory itself.
|
| |
+ Requires: systemd
|
| |
+
|
| |
# tmpfiles.d configuration for the /run directory
|
| |
Source1: %{name}-tmpfiles.conf
|
| |
[...]
|
| |
If a package is dropping a file into _tmpfilesdir, then installing the
package shouldn't lead to an unowned _tmpfilesdir directory. The
package should either depend on something that already owns that
directory (in this case systemd), or own the directory itself (in case
it wants to limit its dependency chain).
In fact, the text before the example spec file says:
"packager needs to ... make sure the directory is included in the
rpm."
That's the second option above.
On a stock Fedora 32 Silverblue system and a stock Fedora 31
Workstation, _tmpfilesdir is only owned by the systemd package.
Therefore, it might be better to have the documentation lean towards
the first alternative of depending on systemd. Ultimately, in reality,
systemd isn't such an onerous addition because all variants of Fedora
use it as part of the base OS, and by using the tmpfiles.d mechanism
the package is implicitly indicating a desire to use systemd.