!58 [sync] PR-57: fix(eagle.spec): 修复升级后无法删除eagle用户的问题

From: @openeuler-sync-bot 
Reviewed-by: @heppen 
Signed-off-by: @heppen
This commit is contained in:
openeuler-ci-bot 2025-05-14 12:21:00 +00:00 committed by Gitee
commit 5c19c5def2
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1,6 +1,6 @@
Name: eagle
Version: 1.1.0
Release: 6
Release: 7
Summary: eagle kit
License: Mulan PSL v2
URL: https://gitee.com/openeuler/eagle
@ -54,7 +54,10 @@ install -m 0755 release/eagle/lib/libsched_service.so %{buildroot}/%{_sysconfdir
install -m 0755 release/eagle/lib/libidle_service.so %{buildroot}/%{_sysconfdir}/eagle/plugin
%post
useradd -m eagle
if [ "$1" -eq 1 ] || [ ! -d /home/eagle ]; then
id eagle &>/dev/null || useradd -m eagle
fi
chown -R eagle:eagle /etc/eagle
if [ ! -d /var/log/eagle ]; then
mkdir /var/log/eagle
@ -74,16 +77,22 @@ sleep 5 # sleep for 5 seconds to wait for powerapi update admin list.
systemctl start eagle.service
%preun
systemctl stop eagle.service
systemctl disable eagle.service
userdel -r eagle
systemctl stop eagle.service || :
systemctl disable eagle.service || :
# 仅在真正卸载($1==0时才删除用户
if [ "$1" -eq 0 ]; then
if id eagle &>/dev/null; then
userdel -r eagle
fi
fi
%post -n python3-eagle-mpctool
systemctl start mpctool.service
systemctl start mpctool.service || :
%preun -n python3-eagle-mpctool
systemctl stop mpctool.service
systemctl disable mpctool.service
systemctl stop mpctool.service || :
systemctl disable mpctool.service || :
%files
%{_sysconfdir}/eagle/*
@ -98,6 +107,9 @@ systemctl disable mpctool.service
%{python3_sitelib}/*
%changelog
* Wed May 14 2025 heppen<hepeng68@huawei.com> - 1.1.0-7
- Bug fix: Unable to delete eagle user after upgrade
* Mon Dec 9 2024 heppen<hepeng68@huawei.com> - 1.1.0-6
- Bug fix: spelling errors of freq_service and idle_service