Use systemd-sysusers --replace

Resolves: rhbz#2193250
This commit is contained in:
Stan Cox 2023-05-25 17:18:09 -04:00
parent 441f5c7c09
commit 9e14b4efc4

View File

@ -33,7 +33,7 @@ end}
Name: grafana
Version: 9.2.10
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Metrics dashboard and graph editor
License: AGPLv3
URL: https://grafana.org
@ -828,7 +828,10 @@ echo "d %{_rundir}/%{name} 0755 %{GRAFANA_USER} %{GRAFANA_GROUP} -" \
install -p -m 644 -D %{SOURCE3} %{buildroot}%{_sysusersdir}/%{name}.conf
%pre
systemd-sysusers %{SOURCE3}
# sysusers_create_compat macro is not present in rhel8
# SOURCE3 may not be available in %%prein stage so specify on command line via --replace
# instead of "systemd-sysusers %%{SOURCE3}"
echo 'u grafana - "Grafana user account"' | systemd-sysusers --replace=/usr/lib/sysusers.d/grafana.conf -
%preun
%systemd_preun grafana-server.service
@ -932,8 +935,11 @@ OPENSSL_FORCE_FIPS_MODE=1 GOLANG_FIPS=1 go test -v ./pkg/util -run TestEncryptio
%changelog
* Tue May 23 2023 Jan Kurik
- Use systemd-sysusers instead of %sysusers_create_compat, which is not available in RHEL-8
* Thu May 25 2023 Stan Cox <scox@redhat.com> 9.2.10-3
- Use systemd-sysusers --replace
* Tue May 23 2023 Jan Kurik <jkurik@redhat.com> 9.2.10-2
- Use systemd-sysusers instead of sysusers_create_compat, which is not available in RHEL-8
* Thu May 04 2023 Stan Cox <scox@redhat.com> 9.2.10-1
- Update to 9.2.10