Stop deleting observability user during upgrades
Adjust the post-uninstallation phase so that the observability user is only deleted during full uninstallation. This prevents the user from being deleted during upgrades and ensures the service contines to work as intended after a major rhel upgrade. Also add precautionary runtime requirements for shadow-utils and util-linux as both are required for the creation of the observability user. The %postun section of the spec was accidentally removed in the previously merged fix for this issue. This commit is identical but fixes this error. Resolves: RHEL-81967 Signed-off-by: ccowman <ccowman@redhat.com>
This commit is contained in:
parent
3acf45a3ea
commit
331c3e1ce7
@ -12,7 +12,7 @@ Collector with the supported components for a Red Hat build of OpenTelemetry}
|
||||
%global godocs README.md
|
||||
|
||||
Name: opentelemetry-collector
|
||||
Release: 3%{?dist}
|
||||
Release: 4%{?dist}
|
||||
Summary: Red Hat build of OpenTelemetry
|
||||
|
||||
License: Apache-2.0
|
||||
@ -26,6 +26,8 @@ BuildRequires: binutils
|
||||
BuildRequires: git
|
||||
BuildRequires: policycoreutils, checkpolicy, selinux-policy-devel
|
||||
|
||||
Requires(pre): shadow-utils
|
||||
Requires(pre): util-linux
|
||||
Requires(pre): /usr/sbin/useradd, /usr/bin/getent
|
||||
Requires(postun): /usr/sbin/userdel
|
||||
|
||||
@ -69,7 +71,9 @@ install -m 0755 -p ./opentelemetry-collector-with-options %{buildroot}%{_bindir}
|
||||
/usr/bin/getent passwd observability > /dev/null || /usr/sbin/useradd -r -M -s /sbin/nologin -g observability -G systemd-journal observability
|
||||
|
||||
%postun
|
||||
/usr/sbin/userdel observability
|
||||
if [ $1 -eq 0 ]; then
|
||||
/usr/sbin/userdel observability
|
||||
fi
|
||||
|
||||
%post
|
||||
semodule -i %{_datadir}/selinux/packages/otel_collector_journald.pp
|
||||
@ -102,6 +106,12 @@ fi
|
||||
%{_bindir}/*
|
||||
|
||||
%changelog
|
||||
* Thu Mar 06 2025 Conor Cowman <ccowman@redhat.com> - 0.107.0-4
|
||||
- Bump revision
|
||||
- Add runtime requirements for shadow-utils and util-linux to ensure successful creation of observability user on installation
|
||||
- Modify post-uninstallation stage to only delete delete the observability user on full uninstallation to prevent the user being deleted during upgrades
|
||||
Resolves: RHEL-81967
|
||||
|
||||
* Wed Feb 12 2025 Conor Cowman <ccowman@redhat.com> - 0.107.0-3
|
||||
- Bump revision
|
||||
- Update tarball golang from 1.21.0 to 1.22.11
|
||||
|
Loading…
Reference in New Issue
Block a user