| |
@@ -135,6 +135,8 @@
|
| |
|
| |
=== Dynamic allocation
|
| |
|
| |
+ ==== Fedora >= 32
|
| |
+
|
| |
To create users and groups in packages using dynamic allocation, do the following:
|
| |
|
| |
Create a `<package-name>.sysusers` file with the user definition and add it to the specfile as a source.
|
| |
@@ -165,6 +167,23 @@
|
| |
[...]
|
| |
```
|
| |
|
| |
+ ==== Fedora < 32, EL7 and EL8
|
| |
+
|
| |
+ In older versions the `%sysusers_create_compat` macro is unavailable.
|
| |
+ To create users and groups in packages using dynamic allocation, use the following:
|
| |
+
|
| |
+ ....
|
| |
+ Requires(pre): shadow-utils
|
| |
+ [...]
|
| |
+
|
| |
+ %pre
|
| |
+ getent group GROUPNAME >/dev/null || groupadd -r GROUPNAME
|
| |
+ getent passwd USERNAME >/dev/null || \
|
| |
+ useradd -r -g GROUPNAME -d HOMEDIR -s /sbin/nologin \
|
| |
+ -c "Useful comment about the purpose of this account" USERNAME
|
| |
+ exit 0
|
| |
+ ....
|
| |
+
|
| |
=== Soft static allocation
|
| |
|
| |
To allocate a UID and/or GID,
|
| |
While Fedora < 32 is not relevant since it's unsupported, EL7 and EL8 are due to EPEL. Ideally speaking the macro would be available there as well, but this fills the gap for now.