From 5f7d1942eddeb73592016361ecba5ada12ca96ea Mon Sep 17 00:00:00 2001 From: shizhendong Date: Wed, 26 Apr 2023 17:39:53 +0800 Subject: [PATCH] =?UTF-8?q?style:=20NEZ-2138=20rpm=20=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E6=97=A5=E5=BF=97=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/afterinstall.sh | 7 ++++--- tools/beforeinstall.sh | 7 +++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/afterinstall.sh b/tools/afterinstall.sh index e91b461..93773fa 100644 --- a/tools/afterinstall.sh +++ b/tools/afterinstall.sh @@ -136,8 +136,10 @@ if [ 2 -eq $1 ];then restoreComponentConfig $PROMTAIL_PATH $TMP_PATH/promtail # telegraf config - restoreComponentConfig $TELEGRAF_PATH $TMP_PATH/telegraf - restoreComponentConfig $TELEGRAF_PATH/telegraf.d $TMP_PATH/telegraf/telegraf.d + if [ -d $TELEGRAF_PATH ];then + restoreComponentConfig $TELEGRAF_PATH $TMP_PATH/telegraf + restoreComponentConfig $TELEGRAF_PATH/telegraf.d $TMP_PATH/telegraf/telegraf.d + fi fi systemctl restart nz-talon @@ -145,7 +147,6 @@ if [ 2 -eq $1 ];then if service_exists nz-promtail; then systemctl restart nz-promtail else - echo 'service nz-promtail not exists,add this service' cat > /usr/lib/systemd/system/nz-promtail.service <<"EOF" [Unit] Description=nz-talon diff --git a/tools/beforeinstall.sh b/tools/beforeinstall.sh index c1cccfa..973c68e 100644 --- a/tools/beforeinstall.sh +++ b/tools/beforeinstall.sh @@ -22,11 +22,14 @@ if [ 2 -eq $1 ];then fi systemctl stop nz-talon - systemctl stop nz-telegraf + + # nz-telegraf.service + if service_exists nz-telegraf; then + systemctl stop nz-telegraf + fi # promtail.service, deprecated if service_exists promtail; then - echo 'service promtail exists, close the service' systemctl stop promtail systemctl disable promtail rm /usr/lib/systemd/system/promtail.service