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

diff --git a/rpm/redhat/main/extras/etcd/EL-10/etcd-sysusers.conf b/rpm/redhat/main/extras/etcd/EL-10/etcd-sysusers.conf
new file mode 120000 (symlink)
index 0000000..2f3212d
--- /dev/null
@@ -0,0 +1 @@
+../main/etcd-sysusers.conf
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/etcd/EL-10/etcd-tmpfiles.d b/rpm/redhat/main/extras/etcd/EL-10/etcd-tmpfiles.d
new file mode 120000 (symlink)
index 0000000..d06e87c
--- /dev/null
@@ -0,0 +1 @@
+../main/etcd-tmpfiles.d
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/etcd/EL-8/etcd-sysusers.conf b/rpm/redhat/main/extras/etcd/EL-8/etcd-sysusers.conf
new file mode 120000 (symlink)
index 0000000..2f3212d
--- /dev/null
@@ -0,0 +1 @@
+../main/etcd-sysusers.conf
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/etcd/EL-8/etcd-tmpfiles.d b/rpm/redhat/main/extras/etcd/EL-8/etcd-tmpfiles.d
new file mode 120000 (symlink)
index 0000000..d06e87c
--- /dev/null
@@ -0,0 +1 @@
+../main/etcd-tmpfiles.d
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/etcd/EL-9/etcd-sysusers.conf b/rpm/redhat/main/extras/etcd/EL-9/etcd-sysusers.conf
new file mode 120000 (symlink)
index 0000000..2f3212d
--- /dev/null
@@ -0,0 +1 @@
+../main/etcd-sysusers.conf
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/etcd/EL-9/etcd-tmpfiles.d b/rpm/redhat/main/extras/etcd/EL-9/etcd-tmpfiles.d
new file mode 120000 (symlink)
index 0000000..d06e87c
--- /dev/null
@@ -0,0 +1 @@
+../main/etcd-tmpfiles.d
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/etcd/SLES-15/etcd-sysusers.conf b/rpm/redhat/main/extras/etcd/SLES-15/etcd-sysusers.conf
new file mode 120000 (symlink)
index 0000000..2f3212d
--- /dev/null
@@ -0,0 +1 @@
+../main/etcd-sysusers.conf
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/etcd/SLES-15/etcd-tmpfiles.d b/rpm/redhat/main/extras/etcd/SLES-15/etcd-tmpfiles.d
new file mode 120000 (symlink)
index 0000000..d06e87c
--- /dev/null
@@ -0,0 +1 @@
+../main/etcd-tmpfiles.d
\ No newline at end of file
diff --git a/rpm/redhat/main/extras/etcd/main/etcd-sysusers.conf b/rpm/redhat/main/extras/etcd/main/etcd-sysusers.conf
new file mode 100644 (file)
index 0000000..48accf8
--- /dev/null
@@ -0,0 +1 @@
+u etcd - 'etcd User' /var/lib/etcd /usr/sbin/nologin
diff --git a/rpm/redhat/main/extras/etcd/main/etcd-tmpfiles.d b/rpm/redhat/main/extras/etcd/main/etcd-tmpfiles.d
new file mode 100644 (file)
index 0000000..c4eab1c
--- /dev/null
@@ -0,0 +1 @@
+d /var/lib/etcd 0700 etcd etcd -
index 1fb36a14ac262b788b10911238848e7db7b4a0bf..77c12ad781acc0513f676774abbe646ecd29855b 100644 (file)
 
 Name:          etcd
 Version:       3.6.5
-Release:       1PGDG%{?dist}
+Release:       2PGDG%{?dist}
 Summary:       Distributed reliable key-value store
 License:       ASL 2.0
 URL:           https://github.com/%{name}-io/%{name}
 Source0:       https://github.com/%{name}-io/%{name}/releases/download/v%{version}/%{name}-v%{version}-linux-%{tarballarch}.tar.gz
 Source1:       %{name}.service
 Source2:       %{name}.conf
+Source6:       %{name}-sysusers.conf
+Source7:       %{name}-tmpfiles.d
 
 BuildRequires: python3-devel
-BuildRequires: systemd-rpm-macros
+BuildRequires: systemd-rpm-macros systemd
+Requires:      systemd
 
-%if 0%{?fedora} || 0%{?rhel}
-Requires(pre): shadow-utils
-%endif
-%if 0%{?suse_version} >= 1500
-Requires(pre): shadow
-%endif
 
 %description
 etcd is a distributed reliable key-value store for the most critical data
@@ -57,10 +54,14 @@ of a distributed system, with a focus on being:
 
 %{__mkdir} -p %{buildroot}/%{_var}/lib/%{name}
 
+%{__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 %{name} >/dev/null || groupadd -r %{name}
-getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/%{name} \
-    -s /sbin/nologin -c "etcd user" %{name}
+%sysusers_create_package %{name} %SOURCE6
 
 %post
 %systemd_post %{name}.service
@@ -77,12 +78,18 @@ getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/
 %dir %attr(750, root, root) %{_sysconfdir}/%{name}
 %dir %attr(750, etcd, etcd) %{_var}/lib/%{name}
 %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
-%{_unitdir}/%{name}.service
 %attr(755, root, root) %{_bindir}/etcd
 %attr(755, root, root) %{_bindir}/etcdctl
 %attr(755, root, root) %{_bindir}/etcdutl
+%{_sysusersdir}/%{name}-pgdg.conf
+%{_tmpfilesdir}/%{name}.conf
+%{_unitdir}/%{name}.service
 
 %changelog
+* Sat Sep 27 2025 Devrim Gündüz <devrim@gunduz.org> 3.6.5-2PGDG
+- Add sysusers.d and tmpfiles.d config file to allow rpm to create
+  users/groups automatically.
+
 * Sun Sep 21 2025 Devrim Gündüz <devrim@gunduz.org> - 3.6.5-1PGDG
 - Update to 3.6.5, per changes described at:
   https://github.com/etcd-io/etcd/releases/tag/v3.6.5