SHA256
1
0
forked from pool/etcd

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
This commit is contained in:
Alexandre Vicenzi 2021-08-09 14:00:42 +00:00 committed by Git OBS Bridge
parent 9f568e8125
commit 6f4a7fda84
3 changed files with 16 additions and 4 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Sun Aug 8 19:17:44 UTC 2021 - Callum Farmer <gmbr3@opensuse.org>
- Change to systemd-sysusers
-------------------------------------------------------------------
Thu May 13 13:42:05 UTC 2021 - alexandre.vicenzi@suse.com

View File

@ -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

2
system-user-etcd.conf Normal file
View File

@ -0,0 +1,2 @@
#Type Name ID GECOS Home directory Shell
u etcd - "etcd daemon" /var/lib/etcd -