consul: Add sysusers.d and tmpfiles.d config file to allow rpm to create users/groups...
authorDevrim Gunduz <devrim@gunduz.org>
Thu, 25 Sep 2025 12:05:11 +0000 (15:05 +0300)
committerDevrim Gunduz <devrim@gunduz.org>
Thu, 25 Sep 2025 12:05:11 +0000 (15:05 +0300)
17 files changed:
rpm/redhat/main/extras/consul/EL-10/consul-sysusers.conf [new symlink]
rpm/redhat/main/extras/consul/EL-10/consul-tmpfiles.d [new symlink]
rpm/redhat/main/extras/consul/EL-8/consul-sysusers.conf [new symlink]
rpm/redhat/main/extras/consul/EL-8/consul-tmpfiles.d [new symlink]
rpm/redhat/main/extras/consul/EL-9/consul-sysusers.conf [new symlink]
rpm/redhat/main/extras/consul/EL-9/consul-tmpfiles.d [new symlink]
rpm/redhat/main/extras/consul/F-41/consul-sysusers.conf [new symlink]
rpm/redhat/main/extras/consul/F-41/consul-tmpfiles.d [new symlink]
rpm/redhat/main/extras/consul/F-42/consul-sysusers.conf [new symlink]
rpm/redhat/main/extras/consul/F-42/consul-tmpfiles.d [new symlink]
rpm/redhat/main/extras/consul/F-43/consul-sysusers.conf [new symlink]
rpm/redhat/main/extras/consul/F-43/consul-tmpfiles.d [new symlink]
rpm/redhat/main/extras/consul/SLES-15/consul-sysusers.conf [new symlink]
rpm/redhat/main/extras/consul/SLES-15/consul-tmpfiles.d [new symlink]
rpm/redhat/main/extras/consul/main/consul-sysusers.conf [new file with mode: 0644]
rpm/redhat/main/extras/consul/main/consul-tmpfiles.d [new file with mode: 0644]
rpm/redhat/main/extras/consul/main/consul.spec

diff --git a/rpm/redhat/main/extras/consul/EL-10/consul-sysusers.conf b/rpm/redhat/main/extras/consul/EL-10/consul-sysusers.conf
new file mode 120000 (symlink)
index 0000000..9f02b79
--- /dev/null
@@ -0,0 +1 @@
+../main/consul-sysusers.conf
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/consul/EL-10/consul-tmpfiles.d b/rpm/redhat/main/extras/consul/EL-10/consul-tmpfiles.d
new file mode 120000 (symlink)
index 0000000..4969055
--- /dev/null
@@ -0,0 +1 @@
+../main/consul-tmpfiles.d
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/consul/EL-8/consul-sysusers.conf b/rpm/redhat/main/extras/consul/EL-8/consul-sysusers.conf
new file mode 120000 (symlink)
index 0000000..9f02b79
--- /dev/null
@@ -0,0 +1 @@
+../main/consul-sysusers.conf
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/consul/EL-8/consul-tmpfiles.d b/rpm/redhat/main/extras/consul/EL-8/consul-tmpfiles.d
new file mode 120000 (symlink)
index 0000000..4969055
--- /dev/null
@@ -0,0 +1 @@
+../main/consul-tmpfiles.d
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/consul/EL-9/consul-sysusers.conf b/rpm/redhat/main/extras/consul/EL-9/consul-sysusers.conf
new file mode 120000 (symlink)
index 0000000..9f02b79
--- /dev/null
@@ -0,0 +1 @@
+../main/consul-sysusers.conf
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/consul/EL-9/consul-tmpfiles.d b/rpm/redhat/main/extras/consul/EL-9/consul-tmpfiles.d
new file mode 120000 (symlink)
index 0000000..4969055
--- /dev/null
@@ -0,0 +1 @@
+../main/consul-tmpfiles.d
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/consul/F-41/consul-sysusers.conf b/rpm/redhat/main/extras/consul/F-41/consul-sysusers.conf
new file mode 120000 (symlink)
index 0000000..9f02b79
--- /dev/null
@@ -0,0 +1 @@
+../main/consul-sysusers.conf
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/consul/F-41/consul-tmpfiles.d b/rpm/redhat/main/extras/consul/F-41/consul-tmpfiles.d
new file mode 120000 (symlink)
index 0000000..4969055
--- /dev/null
@@ -0,0 +1 @@
+../main/consul-tmpfiles.d
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/consul/F-42/consul-sysusers.conf b/rpm/redhat/main/extras/consul/F-42/consul-sysusers.conf
new file mode 120000 (symlink)
index 0000000..9f02b79
--- /dev/null
@@ -0,0 +1 @@
+../main/consul-sysusers.conf
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/consul/F-42/consul-tmpfiles.d b/rpm/redhat/main/extras/consul/F-42/consul-tmpfiles.d
new file mode 120000 (symlink)
index 0000000..4969055
--- /dev/null
@@ -0,0 +1 @@
+../main/consul-tmpfiles.d
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/consul/F-43/consul-sysusers.conf b/rpm/redhat/main/extras/consul/F-43/consul-sysusers.conf
new file mode 120000 (symlink)
index 0000000..9f02b79
--- /dev/null
@@ -0,0 +1 @@
+../main/consul-sysusers.conf
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/consul/F-43/consul-tmpfiles.d b/rpm/redhat/main/extras/consul/F-43/consul-tmpfiles.d
new file mode 120000 (symlink)
index 0000000..4969055
--- /dev/null
@@ -0,0 +1 @@
+../main/consul-tmpfiles.d
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/consul/SLES-15/consul-sysusers.conf b/rpm/redhat/main/extras/consul/SLES-15/consul-sysusers.conf
new file mode 120000 (symlink)
index 0000000..9f02b79
--- /dev/null
@@ -0,0 +1 @@
+../main/consul-sysusers.conf
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/consul/SLES-15/consul-tmpfiles.d b/rpm/redhat/main/extras/consul/SLES-15/consul-tmpfiles.d
new file mode 120000 (symlink)
index 0000000..4969055
--- /dev/null
@@ -0,0 +1 @@
+../main/consul-tmpfiles.d
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/consul/main/consul-sysusers.conf b/rpm/redhat/main/extras/consul/main/consul-sysusers.conf
new file mode 100644 (file)
index 0000000..ae811d4
--- /dev/null
@@ -0,0 +1 @@
+u consul - 'consul.io user' /var/lib/consul /usr/sbin/nologin
diff --git a/rpm/redhat/main/extras/consul/main/consul-tmpfiles.d b/rpm/redhat/main/extras/consul/main/consul-tmpfiles.d
new file mode 100644 (file)
index 0000000..e497d59
--- /dev/null
@@ -0,0 +1 @@
+d /var/lib/consul 0700 consul consul -
index 2dcc46a324db7b576d2af25b7644151fd3d80884..842f2af9bbedce9e673521f329fa524d769ba0dd 100644 (file)
@@ -1,4 +1,4 @@
-%if 0%{?fedora} >= 40 || 0%{?rhel} >= 8
+%if 0%{?fedora} >= 41 || 0%{?rhel} >= 8
 %global                debug_package %{nil}
 %global                _missing_build_ids_terminate_build 0
 %endif
@@ -15,7 +15,7 @@ ExcludeArch:  ppc64le
 
 Name:          consul
 Version:       1.21.5
-Release:       1PGDG%{?dist}
+Release:       2PGDG%{?dist}
 Summary:       Consul is a tool for service discovery and configuration. Consul is distributed, highly available, and extremely scalable.
 
 License:       MPLv2.0
@@ -25,15 +25,10 @@ Source1:    %{name}.sysconfig
 Source2:       %{name}.service
 Source4:       %{name}.json
 Source5:       %{name}.logrotate
+Source6:       %{name}-sysusers.conf
+Source7:       %{name}-tmpfiles.d
 
-BuildRequires: systemd
 Requires:      systemd
-%if 0%{?fedora} >= 37 || 0%{?rhel} >= 7
-Requires(pre): shadow-utils
-%endif
-%if 0%{?suse_version} >= 1315
-Requires(pre): shadow
-%endif
 
 %description
 Consul is a tool for service discovery and configuration. Consul is
@@ -70,12 +65,13 @@ any number of regions without complex configuration.
 %{__mkdir} -p %{buildroot}/%{_unitdir}
 %{__cp} %{SOURCE2} %{buildroot}/%{_unitdir}/
 
+%{__install} -m 0644 -D %{SOURCE6} %{buildroot}%{_sysusersdir}/%{name}-pgdg.conf
+
+%{__mkdir} -p %{buildroot}/%{_tmpfilesdir}
+%{__install} -m 0644 %{SOURCE7} %{buildroot}/%{_tmpfilesdir}/%{name}.conf
+
 %pre
-getent group consul >/dev/null || groupadd -r consul
-getent passwd consul >/dev/null || \
-    useradd -r -g consul -d /var/lib/consul -s /sbin/nologin \
-    -c "consul.io user" consul
-exit 0
+%sysusers_create_package %{name} %SOURCE6
 
 %post
 %systemd_post %{name}.service
@@ -94,9 +90,15 @@ exit 0
 %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
 %{_unitdir}/%{name}.service
 %attr(755, root, root) %{_bindir}/consul
+%{_sysusersdir}/%{name}-pgdg.conf
+%{_tmpfilesdir}/%{name}.conf
 %doc
 
 %changelog
+* Thu Sep 25 2025 Devrim GΓΌndΓΌz <devrim@gunduz.org> 1.21.5-2PGDG
+- Add sysusers.d and tmpfiles.d config file to allow rpm to create
+  users/groups automatically.
+
 * Tue Sep 23 2025 Devrim GΓΌndΓΌz <devrim@gunduz.org> 1.21.5-1PGDG
 - Update to 1.21.5 per changes described at:
   https://github.com/hashicorp/consul/releases/tag/v1.21.5