From 1b11d6b45c8ffdc9413d8522f2622f5a2e10a6f9 Mon Sep 17 00:00:00 2001 From: zeaslity Date: Sun, 28 Apr 2024 16:40:53 +0800 Subject: [PATCH] =?UTF-8?q?[=20agent=20]=20=E5=8E=BB=E9=99=A4=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Public/init-script-wdd.sh | 47 +++++++++++++++++++++++++++++++-------- Public/lib/wdd-lib-env.sh | 2 +- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/Public/init-script-wdd.sh b/Public/init-script-wdd.sh index 1e60bab..27175d8 100644 --- a/Public/init-script-wdd.sh +++ b/Public/init-script-wdd.sh @@ -910,7 +910,7 @@ SyslogIdentifier=octopus-agent User=root Type=simple WorkingDirectory=$octopus_agent_path -ExecStart=$octopus_agent_path/octopus-agent -agentServerInfoConfFile=$octopus_agent_path/octopus-agent.conf -version=standard +ExecStart=$octopus_agent_path/octopus-agent -version=standard ExecStop=/bin/kill -15 \$MAINPID [Install] @@ -927,6 +927,8 @@ EOF rsyslogd -N1 -f /etc/rsyslog.d/octopus-agent.conf systemctl restart rsyslog + colorEchoGreen "Agent守护程序设置成功!" + FunctionEnd } @@ -1019,14 +1021,41 @@ install_octopus_agent() { ls ${octopus_agent_path} | grep ".yaml" echo "" - log "开始配置Agent启动的基础环境信息" - rm -rf "$octopus_agent_path/lib/wdd-lib-env.sh" - wget "${oss_url_prefix}/wdd-lib-env.sh" -qO "${octopus_agent_path}/lib/wdd-lib-env.sh" - SplitGreen - log "开始收集Agent主机的信息!" - echo "" - chmod +x "${octopus_agent_path}/lib/wdd-lib-env.sh" - bash "${octopus_agent_path}/lib/wdd-lib-env.sh" +# log "开始配置Agent启动的基础环境信息" +# rm -rf "$octopus_agent_path/lib/wdd-lib-env.sh" +# wget "${oss_url_prefix}/wdd-lib-env.sh" -qO "${octopus_agent_path}/lib/wdd-lib-env.sh" +# SplitGreen +# log "开始收集Agent主机的信息!" +# echo "" +# chmod +x "${octopus_agent_path}/lib/wdd-lib-env.sh" +# bash "${octopus_agent_path}/lib/wdd-lib-env.sh" + echo "写入备份octopus-server-info-conf文件!" + local agent_server_info_file="$octopus_agent_path/octopus-agent-back.conf" + + touch "$agent_server_info_file" + cat >"$agent_server_info_file" <"$agent_server_info_file" <