!21 更新spec文件,修复关闭服务显示失败的问题
From: @f16lx Reviewed-by: @xingwei-liu Signed-off-by: @xingwei-liu
This commit is contained in:
commit
4498edf5dd
25
0001-use-kill-not-kill-INT-when-stop-service.patch
Normal file
25
0001-use-kill-not-kill-INT-when-stop-service.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
From 192fd69de19a78afe81a5a2c5a8270057f12ee3d Mon Sep 17 00:00:00 2001
|
||||||
|
From: lixin <lixinb@uniontech.com>
|
||||||
|
Date: Mon, 18 Mar 2024 10:32:17 +0800
|
||||||
|
Subject: [PATCH] use kill instead of kill-INT
|
||||||
|
|
||||||
|
---
|
||||||
|
server/migration-tools-server.service | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/server/migration-tools-server.service b/server/migration-tools-server.service
|
||||||
|
index 8cd53a3..dd16c95 100644
|
||||||
|
--- a/server/migration-tools-server.service
|
||||||
|
+++ b/server/migration-tools-server.service
|
||||||
|
@@ -5,7 +5,7 @@ After=network-online.target
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/usr/bin/python3 /usr/lib/migration-tools-server/index.py
|
||||||
|
-ExecStop=/bin/kill-INT $MAINPID
|
||||||
|
+ExecStop=/bin/kill -HUP $MAINPID
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
--
|
||||||
|
2.41.0
|
||||||
|
|
||||||
@ -1,17 +1,18 @@
|
|||||||
Name: migration-tools
|
Name: migration-tools
|
||||||
Version: 1.0.1
|
Version: 1.0.1
|
||||||
Release: 2
|
Release: 3
|
||||||
License: MulanPSL-2.0
|
License: MulanPSL-2.0
|
||||||
Summary: A tool to help users migrate the Centos system to the UOS system and openEuler system
|
Summary: A tool to help users migrate the Centos system to the UOS system and openEuler system
|
||||||
|
Source0: migration-tools.tar.gz
|
||||||
Source0: migration-tools.tar.gz
|
Source1: requires.tar.gz
|
||||||
Source1: requires.tar.gz
|
Source2: xlwt-1.3.0-py2.py3-none-any.whl
|
||||||
Source2: xlwt-1.3.0-py2.py3-none-any.whl
|
# patches
|
||||||
|
Patch0: 0001-use-kill-not-kill-INT-when-stop-service.patch
|
||||||
|
|
||||||
# CVE patches: >= 100
|
# CVE patches: >= 100
|
||||||
Patch100: 0001-CVE-2024-24892.patch
|
Patch100: 100-CVE-2024-24892.patch
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%description
|
%description
|
||||||
UOS Migration Software
|
UOS Migration Software
|
||||||
|
|
||||||
@ -51,7 +52,7 @@ Migration software server side
|
|||||||
%prep
|
%prep
|
||||||
%setup -c
|
%setup -c
|
||||||
|
|
||||||
# cve patches
|
%patch 0 -p1
|
||||||
%patch 100 -p1
|
%patch 100 -p1
|
||||||
|
|
||||||
%if 0%{?openEuler}
|
%if 0%{?openEuler}
|
||||||
@ -64,60 +65,53 @@ rm -rf %{buildroot}
|
|||||||
mkdir -p $RPM_BUILD_ROOT/usr/lib/migration-tools-server
|
mkdir -p $RPM_BUILD_ROOT/usr/lib/migration-tools-server
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/tmp/uos-migration
|
mkdir -p $RPM_BUILD_ROOT/var/tmp/uos-migration
|
||||||
mkdir -p $RPM_BUILD_ROOT/etc/migration-tools
|
mkdir -p $RPM_BUILD_ROOT/etc/migration-tools
|
||||||
|
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
|
||||||
|
|
||||||
cp -r * $RPM_BUILD_ROOT/usr/lib/migration-tools-server/
|
cp -r * $RPM_BUILD_ROOT/usr/lib/migration-tools-server/
|
||||||
|
|
||||||
%if 0%{?rhel} >= 7
|
%if 0%{?rhel} >= 7
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/lib/migration-tools-agent
|
mkdir -p $RPM_BUILD_ROOT/usr/lib/migration-tools-agent
|
||||||
cp -r * $RPM_BUILD_ROOT/usr/lib/migration-tools-agent/
|
cp -r * $RPM_BUILD_ROOT/usr/lib/migration-tools-agent/
|
||||||
|
%{__cp} -r $RPM_BUILD_ROOT/usr/lib/migration-tools-server/server/migration-tools-agent.service $RPM_BUILD_ROOT%{_unitdir}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Install server config
|
# Install server config
|
||||||
%{__cp} -r $RPM_BUILD_ROOT/usr/lib/migration-tools-server/server/migration-tools.conf $RPM_BUILD_ROOT/etc/migration-tools
|
%{__cp} -r $RPM_BUILD_ROOT/usr/lib/migration-tools-server/server/migration-tools.conf $RPM_BUILD_ROOT/etc/migration-tools
|
||||||
|
%{__cp} -r $RPM_BUILD_ROOT/usr/lib/migration-tools-server/server/migration-tools-server.service $RPM_BUILD_ROOT%{_unitdir}
|
||||||
|
|
||||||
|
%posttrans
|
||||||
|
%{_bindir}/systemctl daemon-reload
|
||||||
|
|
||||||
%post -n migration-tools-server
|
%post -n migration-tools-server
|
||||||
pip3 install /usr/lib/migration-tools-server/agent-requires/xlwt-1.3.0-py2.py3-none-any.whl --no-cache-dir
|
pip3 install /usr/lib/migration-tools-server/agent-requires/xlwt-1.3.0-py2.py3-none-any.whl --no-cache-dir
|
||||||
mkdir -p /etc/migration-tools
|
|
||||||
mkdir -p /var/tmp/uos-migration
|
|
||||||
cp -r /usr/lib/migration-tools-server/server/migration-tools-server.service /usr/lib/systemd/system/
|
|
||||||
chmod +x /usr/lib/migration-tools-server/server/start_webview.sh
|
chmod +x /usr/lib/migration-tools-server/server/start_webview.sh
|
||||||
ln -s /usr/lib/migration-tools-server/server/start_webview.sh /usr/bin/migration-tools
|
ln -sf /usr/lib/migration-tools-server/server/start_webview.sh /usr/bin/migration-tools
|
||||||
systemctl daemon-reload
|
|
||||||
systemctl restart migration-tools-server.service
|
|
||||||
systemctl enable migration-tools-server.service
|
|
||||||
|
|
||||||
%if 0%{?rhel} >= 7
|
%preun -n migration-tools-server
|
||||||
%post -n migration-tools-agent
|
if [ $1 = 0 ];then
|
||||||
mkdir -p /etc/migration-tools
|
systemctl stop migration-tools-server.service
|
||||||
mkdir -p /var/tmp/uos-migration
|
fi
|
||||||
cp -r /usr/lib/migration-tools-agent/server/migration-tools-agent.service /usr/lib/systemd/system/
|
|
||||||
systemctl daemon-reload
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%postun -n migration-tools-server
|
%postun -n migration-tools-server
|
||||||
systemctl disable migration-tools-server.service
|
|
||||||
rm -rf /usr/lib/migration-tools-server/
|
|
||||||
rm -rf /usr/lib/migration-tools
|
|
||||||
rm -rf /usr/bin/migration-tools
|
rm -rf /usr/bin/migration-tools
|
||||||
|
|
||||||
%if 0%{?rhel} >= 7
|
|
||||||
%postun -n migration-tools-agent
|
|
||||||
rm -rf /usr/lib/migration-tools-agent/
|
|
||||||
rm -rf /usr/lib/migration-tools
|
|
||||||
rm -rf /usr/bin/migration-tools
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%files -n migration-tools-server
|
%files -n migration-tools-server
|
||||||
/etc/migration-tools
|
/etc/migration-tools
|
||||||
/usr/lib/migration-tools-server
|
/usr/lib/migration-tools-server
|
||||||
|
%{_unitdir}/migration-tools-server.service
|
||||||
|
|
||||||
%if 0%{?rhel} >= 7
|
%if 0%{?rhel} >= 7
|
||||||
%files -n migration-tools-agent
|
%files -n migration-tools-agent
|
||||||
|
/etc/migration-tools
|
||||||
/usr/lib/migration-tools-agent
|
/usr/lib/migration-tools-agent
|
||||||
|
%{_unitdir}/migration-tools-agent.service
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Mar 18 2024 lixin <lixinb@uniontech.com> - 1.0.1-3
|
||||||
|
- fix stop service display failed
|
||||||
|
- update spec
|
||||||
|
|
||||||
* Mon Mar 11 2024 lixin <lixinb@uniontech.com> - 1.0.1-2
|
* Mon Mar 11 2024 lixin <lixinb@uniontech.com> - 1.0.1-2
|
||||||
- fix : CVE-2024-24892
|
- fix : CVE-2024-24892
|
||||||
- use paramiko instead of sshpass to export migration log
|
- use paramiko instead of sshpass to export migration log
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user