From 8a63fb017396f1719c1b5c4def6524a65d27514f Mon Sep 17 00:00:00 2001 From: simonzhangsz Date: Wed, 4 Sep 2024 16:13:15 +0800 Subject: [PATCH] fix: stop service at the begin install --- rpmbuild/SPECS/omc.spec | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/rpmbuild/SPECS/omc.spec b/rpmbuild/SPECS/omc.spec index de43650..1c3aadc 100644 --- a/rpmbuild/SPECS/omc.spec +++ b/rpmbuild/SPECS/omc.spec @@ -60,6 +60,14 @@ chmod +rx ${RPM_BUILD_ROOT}/usr/lib64/* #cd %{buildroot}/.. #make +%install +echo -n "Stopping OMC service ... " +systemctl stop restagent.service +systemctl stop crontask.service +systemctl stop sshsvc.service +systemctl stop captrace.service +echo "done" + # 安装完成后执行 %post OmcRootDir=/usr/local/omc @@ -135,13 +143,6 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then fi fi -echo -n "Stopping OMC service ... " -systemctl stop restagent.service -systemctl stop crontask.service -systemctl stop sshsvc.service -systemctl stop captrace.service -echo "done" - echo -n "Starting OMC service ... " systemctl start captrace.service systemctl start sshsvc.service