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 Name: grafana
Version: 9.2.10 Version: 9.2.10
Release: 2%{?dist} Release: 3%{?dist}
Summary: Metrics dashboard and graph editor Summary: Metrics dashboard and graph editor
License: AGPLv3 License: AGPLv3
URL: https://grafana.org URL: https://grafana.org
@ -76,9 +76,9 @@ Patch4: 0004-remove-unused-backend-dependencies.patch
Patch5: 0005-remove-unused-frontend-crypto.patch Patch5: 0005-remove-unused-frontend-crypto.patch
Patch6: 0006-skip-marketplace-plugin-install-test.patch Patch6: 0006-skip-marketplace-plugin-install-test.patch
Patch7: 0007-fix-alert-test.patch Patch7: 0007-fix-alert-test.patch
Patch8: 0008-graphite-functions-xss.patch Patch8: 0008-graphite-functions-xss.patch
%if 0%{?rhel} >= 9 %if 0%{?rhel} >= 9
Patch9: 0009-redact-weak-ciphers.patch Patch9: 0009-redact-weak-ciphers.patch
%endif %endif
# Patches affecting the vendor tarball # Patches affecting the vendor tarball
@ -99,7 +99,7 @@ BuildRequires: go-rpm-macros
%if %{compile_frontend} %if %{compile_frontend}
BuildRequires: nodejs >= 1:16 BuildRequires: nodejs >= 1:16
BuildRequires: yarnpkg BuildRequires: yarnpkg
%endif %endif
%if %{enable_fips_mode} %if %{enable_fips_mode}
@ -828,7 +828,10 @@ echo "d %{_rundir}/%{name} 0755 %{GRAFANA_USER} %{GRAFANA_GROUP} -" \
install -p -m 644 -D %{SOURCE3} %{buildroot}%{_sysusersdir}/%{name}.conf install -p -m 644 -D %{SOURCE3} %{buildroot}%{_sysusersdir}/%{name}.conf
%pre %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 %preun
%systemd_preun grafana-server.service %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 %changelog
* Tue May 23 2023 Jan Kurik * Thu May 25 2023 Stan Cox <scox@redhat.com> 9.2.10-3
- Use systemd-sysusers instead of %sysusers_create_compat, which is not available in RHEL-8 - 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 * Thu May 04 2023 Stan Cox <scox@redhat.com> 9.2.10-1
- Update to 9.2.10 - Update to 9.2.10