haproxy: Add sysusers.d and tmpfiles.d config file to allow rpm to create users/group...
authorDevrim Gunduz <devrim@gunduz.org>
Sat, 27 Sep 2025 15:52:17 +0000 (16:52 +0100)
committerDevrim Gunduz <devrim@gunduz.org>
Sat, 27 Sep 2025 15:52:17 +0000 (16:52 +0100)
rpm/redhat/main/extras/haproxy/EL-10/haproxy-sysusers.conf [new symlink]
rpm/redhat/main/extras/haproxy/EL-10/haproxy-tmpfiles.d [new symlink]
rpm/redhat/main/extras/haproxy/EL-8/haproxy-sysusers.conf [new symlink]
rpm/redhat/main/extras/haproxy/EL-8/haproxy-tmpfiles.d [new symlink]
rpm/redhat/main/extras/haproxy/EL-9/haproxy-sysusers.conf [new symlink]
rpm/redhat/main/extras/haproxy/EL-9/haproxy-tmpfiles.d [new symlink]
rpm/redhat/main/extras/haproxy/SLES-15/haproxy-sysusers.conf [new symlink]
rpm/redhat/main/extras/haproxy/SLES-15/haproxy-tmpfiles.d [new symlink]
rpm/redhat/main/extras/haproxy/main/haproxy-sysusers.conf [new file with mode: 0644]
rpm/redhat/main/extras/haproxy/main/haproxy-tmpfiles.d [new file with mode: 0644]
rpm/redhat/main/extras/haproxy/main/haproxy.spec

diff --git a/rpm/redhat/main/extras/haproxy/EL-10/haproxy-sysusers.conf b/rpm/redhat/main/extras/haproxy/EL-10/haproxy-sysusers.conf
new file mode 120000 (symlink)
index 0000000..bf6db03
--- /dev/null
@@ -0,0 +1 @@
+../main/haproxy-sysusers.conf
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/haproxy/EL-10/haproxy-tmpfiles.d b/rpm/redhat/main/extras/haproxy/EL-10/haproxy-tmpfiles.d
new file mode 120000 (symlink)
index 0000000..573a024
--- /dev/null
@@ -0,0 +1 @@
+../main/haproxy-tmpfiles.d
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/haproxy/EL-8/haproxy-sysusers.conf b/rpm/redhat/main/extras/haproxy/EL-8/haproxy-sysusers.conf
new file mode 120000 (symlink)
index 0000000..bf6db03
--- /dev/null
@@ -0,0 +1 @@
+../main/haproxy-sysusers.conf
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/haproxy/EL-8/haproxy-tmpfiles.d b/rpm/redhat/main/extras/haproxy/EL-8/haproxy-tmpfiles.d
new file mode 120000 (symlink)
index 0000000..573a024
--- /dev/null
@@ -0,0 +1 @@
+../main/haproxy-tmpfiles.d
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/haproxy/EL-9/haproxy-sysusers.conf b/rpm/redhat/main/extras/haproxy/EL-9/haproxy-sysusers.conf
new file mode 120000 (symlink)
index 0000000..bf6db03
--- /dev/null
@@ -0,0 +1 @@
+../main/haproxy-sysusers.conf
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/haproxy/EL-9/haproxy-tmpfiles.d b/rpm/redhat/main/extras/haproxy/EL-9/haproxy-tmpfiles.d
new file mode 120000 (symlink)
index 0000000..573a024
--- /dev/null
@@ -0,0 +1 @@
+../main/haproxy-tmpfiles.d
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/haproxy/SLES-15/haproxy-sysusers.conf b/rpm/redhat/main/extras/haproxy/SLES-15/haproxy-sysusers.conf
new file mode 120000 (symlink)
index 0000000..bf6db03
--- /dev/null
@@ -0,0 +1 @@
+../main/haproxy-sysusers.conf
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/haproxy/SLES-15/haproxy-tmpfiles.d b/rpm/redhat/main/extras/haproxy/SLES-15/haproxy-tmpfiles.d
new file mode 120000 (symlink)
index 0000000..573a024
--- /dev/null
@@ -0,0 +1 @@
+../main/haproxy-tmpfiles.d
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/haproxy/main/haproxy-sysusers.conf b/rpm/redhat/main/extras/haproxy/main/haproxy-sysusers.conf
new file mode 100644 (file)
index 0000000..83b1a8d
--- /dev/null
@@ -0,0 +1 @@
+u haproxy - 'HAProxy User' /var/lib/haproxy /usr/sbin/nologin
diff --git a/rpm/redhat/main/extras/haproxy/main/haproxy-tmpfiles.d b/rpm/redhat/main/extras/haproxy/main/haproxy-tmpfiles.d
new file mode 100644 (file)
index 0000000..b97945f
--- /dev/null
@@ -0,0 +1 @@
+d /var/lib/haproxy 0700 haproxy haproxy -
index 8c8f050bbc5e22eb1a4ce46e94a0c224287fbdd4..5a8b3e8fa78685a1036d85e8d282f8b550dc2904 100644 (file)
@@ -8,7 +8,7 @@
 
 Name:          haproxy
 Version:       3.2.5
-Release:       1PGDG%{?dist}
+Release:       2PGDG%{?dist}
 Summary:       HAProxy reverse proxy for high availability environments
 
 License:       GPLv2+
@@ -20,16 +20,12 @@ Source2:    %{name}.cfg
 Source3:       %{name}.logrotate
 Source4:       %{name}.sysconfig
 Source5:       halog.1
+Source6:       %{name}-sysusers.conf
+Source7:       %{name}-tmpfiles.d
 
 BuildRequires: gcc lua-devel pcre2-devel make
 BuildRequires: openssl-devel systemd-devel systemd
 
-%if 0%{?fedora} >= 40 || 0%{?rhel} >= 8
-Requires(pre): shadow-utils
-%else
-Requires(pre): shadow
-%endif
-
 %{?systemd_requires}
 
 %description
@@ -107,13 +103,13 @@ do
     %{__rm} -f $textfile.old
 done
 
+%{__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 %{haproxy_group} >/dev/null || \
-    groupadd -r %{haproxy_group}
-getent passwd %{haproxy_user} >/dev/null || \
-    useradd -r -g %{haproxy_user} -d %{haproxy_homedir} \
-    -s /sbin/nologin -c "haproxy" %{haproxy_user}
-exit 0
+%sysusers_create_package %{name} %SOURCE6
 
 %post
 %systemd_post %{name}.service
@@ -141,8 +137,14 @@ exit 0
 %{_bindir}/iprange
 %{_bindir}/ip6range
 %{_mandir}/man1/*
+%{_sysusersdir}/%{name}-pgdg.conf
+%{_tmpfilesdir}/%{name}.conf
 
 %changelog
+* Sat Sep 27 2025 Devrim Gündüz <devrim@gunduz.org> 3.2.5-2PGDG
+- Add sysusers.d and tmpfiles.d config file to allow rpm to create
+  users/groups automatically.
+
 * Wed Sep 24 2025 Devrim Gündüz <devrim@gunduz.org> 3.2.5-1PGDG
 - Update to 3.2.5 per changes described at:
   https://www.mail-archive.com/haproxy@formilux.org/msg46051.html