From 6f4a7fda8494b037c9bac17278719491a30d3307f325e3a57d5a841e405d115f Mon Sep 17 00:00:00 2001 From: Alexandre Vicenzi Date: Mon, 9 Aug 2021 14:00:42 +0000 Subject: [PATCH 1/2] Accepting request 910730 from home:gmbr3:Active - Change to systemd-sysusers OBS-URL: https://build.opensuse.org/request/show/910730 OBS-URL: https://build.opensuse.org/package/show/devel:kubic/etcd?expand=0&rev=15 --- etcd.changes | 5 +++++ etcd.spec | 13 +++++++++---- system-user-etcd.conf | 2 ++ 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 system-user-etcd.conf diff --git a/etcd.changes b/etcd.changes index 592215a..bdd8f68 100644 --- a/etcd.changes +++ b/etcd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Aug 8 19:17:44 UTC 2021 - Callum Farmer + +- Change to systemd-sysusers + ------------------------------------------------------------------- Thu May 13 13:42:05 UTC 2021 - alexandre.vicenzi@suse.com diff --git a/etcd.spec b/etcd.spec index fdc8477..509e3c8 100644 --- a/etcd.spec +++ b/etcd.spec @@ -33,13 +33,15 @@ Source1: vendor.tar.gz Source11: %{name}.conf Source12: %{name}.service Source15: README.security +Source16: system-user-etcd.conf BuildRequires: golang(API) = 1.14 BuildRequires: golang-packaging -BuildRequires: shadow +BuildRequires: sysuser-tools BuildRequires: systemd-rpm-macros BuildRequires: xz Requires(post): %fillup_prereq ExcludeArch: s390 %ix86 +%sysusers_requires %{?systemd_requires} %{go_provides} # Make sure that the binary is not getting stripped. @@ -74,6 +76,8 @@ mkdir -p ./bin go build -v -buildmode=pie -mod=vendor -o ./bin/etcd go build -v -buildmode=pie -mod=vendor -o ./bin/etcdctl ./etcdctl +%sysusers_generate_pre %{SOURCE16} %{name} system-user-etcd.conf + %install install -d %{buildroot}/%{_sbindir} install -D -m 0755 ./bin/etcd %{buildroot}/%{_sbindir}/etcd @@ -95,9 +99,9 @@ echo -e "\n#Enable arm64\nETCD_UNSUPPORTED_ARCH=arm64\n" >> %{buildroot}%{_fillu # Additional install -d -m 750 %{buildroot}%{_localstatedir}/lib/%{name} -%pre -getent group %{name} >/dev/null || %{_sbindir}/groupadd -r %{name} -getent passwd %{name} >/dev/null || %{_sbindir}/useradd -r -g %{name} -d %{_localstatedir}/lib/%{name} -s /bin/false -c "etcd daemon" %{name} +install -Dm0644 %{SOURCE16} %{buildroot}%{_sysusersdir}/system-user-etcd.conf + +%pre -f %{name}.pre %service_add_pre %{name}.service %post @@ -114,6 +118,7 @@ getent passwd %{name} >/dev/null || %{_sbindir}/useradd -r -g %{name} -d %{_loca %license LICENSE %doc CONTRIBUTING.md README.md DCO NOTICE README.security %{_sbindir}/%{name} +%{_sysusersdir}/system-user-etcd.conf # Service %{_unitdir}/%{name}.service diff --git a/system-user-etcd.conf b/system-user-etcd.conf new file mode 100644 index 0000000..cf5fbeb --- /dev/null +++ b/system-user-etcd.conf @@ -0,0 +1,2 @@ +#Type Name ID GECOS Home directory Shell +u etcd - "etcd daemon" /var/lib/etcd - From 1a5ad6129c6a0520cda5fef05832a128269f41f3298e7f78688f1fd7139b549b Mon Sep 17 00:00:00 2001 From: Thorsten Kukuk Date: Mon, 9 Aug 2021 14:23:12 +0000 Subject: [PATCH 2/2] - Don't require systemd (works without, too) - Change to sysuser-tools to create system user OBS-URL: https://build.opensuse.org/package/show/devel:kubic/etcd?expand=0&rev=16 --- etcd.changes | 7 ++++++- etcd.spec | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/etcd.changes b/etcd.changes index bdd8f68..c900e67 100644 --- a/etcd.changes +++ b/etcd.changes @@ -1,7 +1,12 @@ +------------------------------------------------------------------- +Mon Aug 9 14:22:24 UTC 2021 - Thorsten Kukuk + +- Don't require systemd (works without, too) + ------------------------------------------------------------------- Sun Aug 8 19:17:44 UTC 2021 - Callum Farmer -- Change to systemd-sysusers +- Change to sysuser-tools to create system user ------------------------------------------------------------------- Thu May 13 13:42:05 UTC 2021 - alexandre.vicenzi@suse.com diff --git a/etcd.spec b/etcd.spec index 509e3c8..4bab4b5 100644 --- a/etcd.spec +++ b/etcd.spec @@ -42,7 +42,6 @@ BuildRequires: xz Requires(post): %fillup_prereq ExcludeArch: s390 %ix86 %sysusers_requires -%{?systemd_requires} %{go_provides} # Make sure that the binary is not getting stripped. %{go_nostrip}