From 1c565bdd6198b68b1cdb494d1561e78dc456aabc Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Sat, 21 Sep 2024 12:11:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20deb=E5=AE=89=E8=A3=85=E5=89=8Dsystemctl?= =?UTF-8?q?=20stop=E7=9A=84=E6=93=8D=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/postinst | 8 ++++---- debbuild/22.04/DEBIAN/preinst | 17 +++++++++-------- debbuild/DEBIAN/postinst | 8 ++++---- debbuild/DEBIAN/preinst | 17 +++++++++-------- 4 files changed, 26 insertions(+), 24 deletions(-) diff --git a/debbuild/22.04/DEBIAN/postinst b/debbuild/22.04/DEBIAN/postinst index 7a6f455..06f83f0 100644 --- a/debbuild/22.04/DEBIAN/postinst +++ b/debbuild/22.04/DEBIAN/postinst @@ -100,8 +100,8 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then fi echo -n "Starting OMC service ... " -systemctl restart crontask.service -systemctl restart sshsvc.service -systemctl restart captrace.service -systemctl restart restagent.service +systemctl start crontask.service +systemctl start sshsvc.service +systemctl start captrace.service +systemctl start restagent.service echo "done" diff --git a/debbuild/22.04/DEBIAN/preinst b/debbuild/22.04/DEBIAN/preinst index 9a2c870..8c7ea39 100644 --- a/debbuild/22.04/DEBIAN/preinst +++ b/debbuild/22.04/DEBIAN/preinst @@ -1,18 +1,19 @@ # !/bin/bash -FERootDir=/usr/local/omc/htdocs/front - echo -n "Stopping OMC service ... " -systemctl stop restagent.service -systemctl stop crontask.service -systemctl stop sshsvc.service -systemctl stop captrace.service +systemctl daemon-reload +if systemctl list-units --type=service --all | grep -q 'restagent.service'; then + systemctl stop restagent.service + systemctl stop crontask.service + systemctl stop sshsvc.service + systemctl stop captrace.service +fi echo "done" +FERootDir=/usr/local/omc/htdocs/front + # apt-get install zip # clear front-end old hash js files rm -rf ${FERootDir}/assets rm -rf ${FERootDir}/js rm -rf ${FERootDir}/index.*.js - - diff --git a/debbuild/DEBIAN/postinst b/debbuild/DEBIAN/postinst index 7393c16..c67e466 100644 --- a/debbuild/DEBIAN/postinst +++ b/debbuild/DEBIAN/postinst @@ -100,8 +100,8 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then fi echo -n "Starting OMC service ... " -systemctl restart crontask.service -systemctl restart sshsvc.service -systemctl restart captrace.service -systemctl restart restagent.service +systemctl start crontask.service +systemctl start sshsvc.service +systemctl start captrace.service +systemctl start restagent.service echo "done" diff --git a/debbuild/DEBIAN/preinst b/debbuild/DEBIAN/preinst index 9a2c870..8c7ea39 100644 --- a/debbuild/DEBIAN/preinst +++ b/debbuild/DEBIAN/preinst @@ -1,18 +1,19 @@ # !/bin/bash -FERootDir=/usr/local/omc/htdocs/front - echo -n "Stopping OMC service ... " -systemctl stop restagent.service -systemctl stop crontask.service -systemctl stop sshsvc.service -systemctl stop captrace.service +systemctl daemon-reload +if systemctl list-units --type=service --all | grep -q 'restagent.service'; then + systemctl stop restagent.service + systemctl stop crontask.service + systemctl stop sshsvc.service + systemctl stop captrace.service +fi echo "done" +FERootDir=/usr/local/omc/htdocs/front + # apt-get install zip # clear front-end old hash js files rm -rf ${FERootDir}/assets rm -rf ${FERootDir}/js rm -rf ${FERootDir}/index.*.js - -