From bf8cfc272d929111eda6d9a3652ee2a9af8a41d7 Mon Sep 17 00:00:00 2001 From: spiritlhl <103393591+spiritLHLS@users.noreply.github.com> Date: Wed, 1 Nov 2023 02:57:46 +0000 Subject: [PATCH] 2023.11.01 --- install_scripts/dlm.sh | 109 ++++++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 50 deletions(-) diff --git a/install_scripts/dlm.sh b/install_scripts/dlm.sh index 63df68b..3e57b6c 100644 --- a/install_scripts/dlm.sh +++ b/install_scripts/dlm.sh @@ -27,7 +27,7 @@ _blue() { echo -e "\033[36m\033[01m$@\033[0m"; } reading() { read -rp "$(_green "$1")" "$2"; } uninstall_qcloud() { - # 删除腾讯云监控组件 + # 腾讯云 /usr/local/qcloud/stargate/admin/uninstall.sh /usr/local/qcloud/YunJing/uninst.sh /usr/local/qcloud/monitor/barad/admin/uninstall.sh @@ -36,6 +36,62 @@ uninstall_qcloud() { rm -rf /usr/local/qcloud } +uninstall_oralce() { + # 甲骨文云 + systemctl stop oracle-cloud-agent + systemctl disable oracle-cloud-agent + systemctl stop oracle-cloud-agent-updater + systemctl disable oracle-cloud-agent-updater + systemctl disable --now qemu-guest-agent + if command -v snap >/dev/null 2>&1; then + snap remove oracle-cloud-agent + fi +} + +uninstall_jdcloud() { + # 其他云 + /etc/KsyunAgent/uninstall.py + service uma stop + systemctl disable --now uma + /usr/local/uniagent/extension/install/telescope/telescoped stop + # 京东云 + systemctl stop --no-block jcs-agent-core + systemctl --no-reload disable jcs-agent-core + if command -v stop >/dev/null 2>&1; then + stop --no-wait jcs-agent-core /etc/init.d/jcs-agent-core + fi + + if [[ -f "/etc/centos-release" && $(grep ' 6' "/etc/centos-release") ]]; then + chkconfig --level 2345 expand-root off >/dev/null 2>&1 + sysv-rc-conf --level 2345 expand-root off >/dev/null 2>&1 + rm -rf "/usr/share/dracut/modules.d/50growroot" + dracut --force + rm -f "/usr/bin/sgdisk" + rm -f "/usr/bin/growpart" + fi + + systemctl stop --no-block jcs-shutdown-scripts + systemctl stop --no-block jcs-entry + systemctl --no-reload disable jcs-shutdown-scripts + systemctl --no-reload disable jcs-entry + if command -v stop >/dev/null 2>&1; then + stop --no-wait jcs-shutdown-scripts + stop --no-wait jcs-entry + stop --no-wait /etc/init.d/jcs-shutdown-scripts + stop --no-wait /etc/init.d/jcs-entry + fi + service jcs-entry stop + service jcs-shutdown-scripts stop + chkconfig jcs-entry off >/dev/null 2>&1 + chkconfig jcs-shutdown-scripts off >/dev/null 2>&1 + sysv-rc-conf jcs-entry off >/dev/null 2>&1 + sysv-rc-conf jcs-shutdown-scripts off >/dev/null 2>&1 + update-rc.d jcs-entry remove + update-rc.d jcs-shutdown-scripts remove + pkill jdog + rm -rf "/usr/local/share/jcloud" +} + kill_processes() { local process local killall_processes=("aegis_cli" "aegis_update" "AliYunDun" "AliYunDunMonitor" "AliHids" "AliHips" "AliYunDunUpdate") @@ -138,55 +194,6 @@ uninstall_cloud_monitoring() { rm -rf "$AEGIS_INSTALL_DIR" rm -rf "/usr/local/share/aliyun-assist" rm -rf "/usr/local/cloudmonitor" - - # 甲骨文云 - systemctl stop oracle-cloud-agent - systemctl disable oracle-cloud-agent - systemctl stop oracle-cloud-agent-updater - systemctl disable oracle-cloud-agent-updater - systemctl disable --now qemu-guest-agent - - # 其他云的卸载 - /etc/KsyunAgent/uninstall.py - service uma stop - systemctl disable --now uma - /usr/local/uniagent/extension/install/telescope/telescoped stop - systemctl stop --no-block jcs-agent-core - systemctl --no-reload disable jcs-agent-core - if command -v stop >/dev/null 2>&1; then - stop --no-wait jcs-agent-core /etc/init.d/jcs-agent-core - fi - - if [[ -f "/etc/centos-release" && $(grep ' 6' "/etc/centos-release") ]]; then - chkconfig --level 2345 expand-root off >/dev/null 2>&1 - sysv-rc-conf --level 2345 expand-root off >/dev/null 2>&1 - rm -rf "/usr/share/dracut/modules.d/50growroot" - dracut --force - rm -f "/usr/bin/sgdisk" - rm -f "/usr/bin/growpart" - fi - - systemctl stop --no-block jcs-shutdown-scripts - systemctl stop --no-block jcs-entry - systemctl --no-reload disable jcs-shutdown-scripts - systemctl --no-reload disable jcs-entry - if command -v stop >/dev/null 2>&1; then - stop --no-wait jcs-shutdown-scripts - stop --no-wait jcs-entry - stop --no-wait /etc/init.d/jcs-shutdown-scripts - stop --no-wait /etc/init.d/jcs-entry - fi - service jcs-entry stop - service jcs-shutdown-scripts stop - chkconfig jcs-entry off >/dev/null 2>&1 - chkconfig jcs-shutdown-scripts off >/dev/null 2>&1 - sysv-rc-conf jcs-entry off >/dev/null 2>&1 - sysv-rc-conf jcs-shutdown-scripts off >/dev/null 2>&1 - update-rc.d jcs-entry remove - update-rc.d jcs-shutdown-scripts remove - pkill jdog - rm -rf "/usr/local/share/jcloud" - } check_root() { @@ -301,6 +308,8 @@ rescue_localhost_name() { check_root touch /etc/cloud/cloud-init.disabled uninstall_qcloud +uninstall_oralce +uninstall_jdcloud kill_processes pkill_processes wait_aegis_exit