更新spec文件,修复关闭服务显示失败的问题
This commit is contained in:
parent
8c8d6b82e5
commit
74b96ce31d
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,20 @@
|
||||
Name: migration-tools
|
||||
Version: 1.0.1
|
||||
Release: 2
|
||||
License: MulanPSL-2.0
|
||||
Summary: A tool to help users migrate the Centos system to the UOS system and openEuler system
|
||||
%define __python /usr/bin/python3
|
||||
|
||||
Source0: migration-tools.tar.gz
|
||||
Source1: requires.tar.gz
|
||||
Source2: xlwt-1.3.0-py2.py3-none-any.whl
|
||||
Name: migration-tools
|
||||
Version: 1.0.1
|
||||
Release: 3
|
||||
License: MulanPSL-2.0
|
||||
Summary: A tool to help users migrate the Centos system to the UOS system and openEuler system
|
||||
Source0: migration-tools.tar.gz
|
||||
Source1: requires.tar.gz
|
||||
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
|
||||
Patch100: 0001-CVE-2024-24892.patch
|
||||
Patch100: 100-CVE-2024-24892.patch
|
||||
|
||||
BuildArch: noarch
|
||||
BuildArch: noarch
|
||||
%description
|
||||
UOS Migration Software
|
||||
|
||||
@ -40,6 +43,7 @@ Summary: migration-tools-server
|
||||
License: MulanPSL-2.0
|
||||
Requires: python3
|
||||
Requires: python3-pip
|
||||
Requires: sshpass
|
||||
Requires: python3-paramiko
|
||||
Requires: python3-flask
|
||||
Requires: python3-requests
|
||||
@ -51,7 +55,7 @@ Migration software server side
|
||||
%prep
|
||||
%setup -c
|
||||
|
||||
# cve patches
|
||||
%patch 0 -p1
|
||||
%patch 100 -p1
|
||||
|
||||
%if 0%{?openEuler}
|
||||
@ -64,60 +68,53 @@ rm -rf %{buildroot}
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/lib/migration-tools-server
|
||||
mkdir -p $RPM_BUILD_ROOT/var/tmp/uos-migration
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/migration-tools
|
||||
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
|
||||
|
||||
cp -r * $RPM_BUILD_ROOT/usr/lib/migration-tools-server/
|
||||
|
||||
%if 0%{?rhel} >= 7
|
||||
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-server/server/migration-tools-agent.service $RPM_BUILD_ROOT%{_unitdir}
|
||||
%endif
|
||||
|
||||
# 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-server.service $RPM_BUILD_ROOT%{_unitdir}
|
||||
|
||||
%posttrans
|
||||
%{_bindir}/systemctl daemon-reload
|
||||
|
||||
%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
|
||||
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
|
||||
ln -s /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
|
||||
ln -sf /usr/lib/migration-tools-server/server/start_webview.sh /usr/bin/migration-tools
|
||||
|
||||
%if 0%{?rhel} >= 7
|
||||
%post -n migration-tools-agent
|
||||
mkdir -p /etc/migration-tools
|
||||
mkdir -p /var/tmp/uos-migration
|
||||
cp -r /usr/lib/migration-tools-agent/server/migration-tools-agent.service /usr/lib/systemd/system/
|
||||
systemctl daemon-reload
|
||||
%endif
|
||||
%preun -n migration-tools-server
|
||||
if [ $1 = 0 ];then
|
||||
systemctl stop migration-tools-server.service
|
||||
fi
|
||||
|
||||
%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
|
||||
|
||||
%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
|
||||
/etc/migration-tools
|
||||
/usr/lib/migration-tools-server
|
||||
%{_unitdir}/migration-tools-server.service
|
||||
|
||||
%if 0%{?rhel} >= 7
|
||||
%files -n migration-tools-agent
|
||||
/etc/migration-tools
|
||||
/usr/lib/migration-tools-agent
|
||||
%{_unitdir}/migration-tools-agent.service
|
||||
%endif
|
||||
|
||||
%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
|
||||
- fix : CVE-2024-24892
|
||||
- use paramiko instead of sshpass to export migration log
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user