From eea255ff95b21cd38f02be752e39602ee55eac86 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Sat, 21 Sep 2024 16:32:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20deb=E5=8D=B8=E8=BD=BDsystemctl=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debbuild/22.04/DEBIAN/postrm | 21 +++++++++++---------- debbuild/DEBIAN/postrm | 21 +++++++++++---------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/debbuild/22.04/DEBIAN/postrm b/debbuild/22.04/DEBIAN/postrm index 0d1573d..d3020a8 100644 --- a/debbuild/22.04/DEBIAN/postrm +++ b/debbuild/22.04/DEBIAN/postrm @@ -9,22 +9,23 @@ rm -rf ${X86Lib64Dir}/libwsutil.so.13 rm -rf ${X86Lib64Dir}/libwsutil.so #rm -rf /usr/local/omc -rm -rf /usr/local/etc/omc rm -rf /etc/nginx/conf.d/omc.conf rm -f /usr/local/bin/omcd -echo -n "Stopping OMC service ... " -systemctl stop restagent.service -systemctl stop crontask.service -systemctl stop sshsvc.service -systemctl stop captrace.service -echo "done" +systemctl daemon-reload + +if systemctl list-units --type=service --all | grep -q 'restagent.service'; then + echo -n "Stopping OMC service ... " + systemctl stop restagent.service + systemctl stop crontask.service + systemctl stop sshsvc.service + systemctl stop captrace.service + echo "done" +fi -echo -n "Disable OMC service ... " systemctl disable restagent.service systemctl disable crontask.service systemctl disable sshsvc.service systemctl disable captrace.service -echo "done" -systemctl daemon-reload \ No newline at end of file +systemctl daemon-reload diff --git a/debbuild/DEBIAN/postrm b/debbuild/DEBIAN/postrm index 0d1573d..d3020a8 100644 --- a/debbuild/DEBIAN/postrm +++ b/debbuild/DEBIAN/postrm @@ -9,22 +9,23 @@ rm -rf ${X86Lib64Dir}/libwsutil.so.13 rm -rf ${X86Lib64Dir}/libwsutil.so #rm -rf /usr/local/omc -rm -rf /usr/local/etc/omc rm -rf /etc/nginx/conf.d/omc.conf rm -f /usr/local/bin/omcd -echo -n "Stopping OMC service ... " -systemctl stop restagent.service -systemctl stop crontask.service -systemctl stop sshsvc.service -systemctl stop captrace.service -echo "done" +systemctl daemon-reload + +if systemctl list-units --type=service --all | grep -q 'restagent.service'; then + echo -n "Stopping OMC service ... " + systemctl stop restagent.service + systemctl stop crontask.service + systemctl stop sshsvc.service + systemctl stop captrace.service + echo "done" +fi -echo -n "Disable OMC service ... " systemctl disable restagent.service systemctl disable crontask.service systemctl disable sshsvc.service systemctl disable captrace.service -echo "done" -systemctl daemon-reload \ No newline at end of file +systemctl daemon-reload