Stop and uninstall Cloud Assistant Agent

更新时间:
复制 MD 格式

Stopping or uninstalling Cloud Assistant Agent disables remote logon, OOS command execution, and self-service troubleshooting.

Stop Cloud Assistant Agent

Important

If you are connected via Session Manager or Workbench, stopping the agent terminates your session. Connect using another method first, such as Workbench terminal connection, third-party client tool (SSH), or VNC.

Linux

  1. Connect to a Linux instance by using a username and password.

  2. Stop the daemon process.

    The daemon process monitors Cloud Assistant Agent and restarts it automatically. Stop the daemon first.
    sudo /usr/local/share/assist-daemon/assist_daemon --stop
  3. Identify the init system.

    The stop command differs by init system. Identify which one your instance uses.
    • systemd: Alibaba Cloud Linux, CentOS 7+, Red Hat Enterprise Linux (RHEL) 7+, Fedora 15+, Ubuntu 15.04+, Debian 8+, and others.

    • Upstart: Ubuntu 6.10-14.10, RHEL 6, CentOS 6, and others.

    • SysVinit: RHEL 5, CentOS 5, Debian 6, and others.

  4. Stop Cloud Assistant Agent.

    systemd

    sudo systemctl stop aliyun.service
    
    # Verify that the service has stopped. The service is stopped if the output contains "inactive (dead)".
    sudo systemctl status aliyun.service

    Upstart

    sudo /sbin/initctl stop aliyun-service
    
    # Verify that the service has stopped. The service is stopped if the output is empty.
    ps aux | grep -v grep | grep "aliyun-service"

    SysVinit

    sudo /etc/init.d/aliyun-service stop
    
    # Verify that the service has stopped. The service is stopped if the output is empty.
    ps aux | grep -v grep | grep "aliyun-service"

Windows

Method 1: Use the Windows Services console

  1. Use RDP client or Windows App.

  2. Click the Start icon and select Windows Administrative Tools > Computer Management.

  3. In the left pane, go to Computer Management (Local) > Services and Applications > Services.

  4. Find Aliyun Assist Service and click Stop the service.

    Stop the service

Method 2: Use Windows PowerShell

  1. Use RDP client or Windows App.

  2. Click the Start icon, find Windows PowerShell, right-click it, and select Run as administrator.

  3. Stop Cloud Assistant Agent.

    Stop-Service -Name "AliyunService"
  4. Verify that the agent has stopped.

    The agent is stopped if Status is Stopped.

    Get-Service -Name "AliyunService"

Uninstall Cloud Assistant Agent

Important

If you are connected via Session Manager or Workbench, stopping the agent terminates your session. Connect using another method first, such as Workbench terminal connection, SSH, or VNC.

Linux

  1. Stop Cloud Assistant Agent.

  2. Delete the daemon process.

    sudo /usr/local/share/assist-daemon/assist_daemon --delete
  3. Uninstall the package.

    • RPM: For Alibaba Cloud Linux, CentOS, RHEL, Fedora, Rocky Linux, openSUSE, and others.

    • DEB: For Debian, Ubuntu, and others.

      RPM

      sudo rpm -qa | grep aliyun_assist | xargs sudo rpm -e

      DEB

      sudo apt-get purge -y aliyun-assist
  4. Clean up residual files and service configs.

    sudo rm -rf /usr/local/share/aliyun-assist
    sudo rm -rf /usr/local/share/assist-daemon
    sudo rm -f /etc/systemd/system/aliyun.service
    sudo rm -f /etc/init.d/aliyun-service
  5. Verify that the agent is uninstalled.

    The agent is uninstalled if the output is empty.

    ps aux | grep -v grep | grep "aliyun-service"

Windows

Method 1: Use the Windows desktop interface

  1. Stop the Cloud Assistant Agent.

  2. In File Explorer, go to the View tab, select Hidden items, and delete the C:\ProgramData\aliyun\assist directory.

    d5c8f2f19778bba6247adb09143d4d1a

Method 2: Use Windows PowerShell

  1. Use RDP client or Windows App.

  2. Click the Start icon, find Windows PowerShell, right-click it, and select Run as administrator.

  3. Stop Cloud Assistant Agent.

    Stop-Service -Name "AliyunService" -Force
  4. Delete the installation directory and registry.

    # Delete the installation directory
    Remove-Item -Path "C:\ProgramData\aliyun\assist" -Recurse -Force
    
    # Delete the registry entry
    Remove-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Services\AliyunService" -Recurse -Force
  5. Verify that the agent is uninstalled.

    The agent is uninstalled if the output is empty or shows Cannot find any service with service name 'AliyunService'.

    Get-Service -Name "AliyunService"

FAQ

How do I restart Cloud Assistant Agent after stopping it?

Linux

  1. Connect to a Linux instance by using a username and password.

  2. Start the daemon process.

    sudo /usr/local/share/assist-daemon/assist_daemon --start
  3. Identify the init system type.

  4. Start Cloud Assistant Agent.

    systemd

    sudo systemctl start aliyun.service
    
    # Verify that the service has started. The service is running if the output contains "active (running)".
    sudo systemctl status aliyun.service

    Upstart

    sudo /sbin/initctl start aliyun-service
    
    # Verify that the service has started. The service is running if the output is not empty.
    ps aux | grep -v grep | grep "aliyun-service"

    SysVinit

    sudo /etc/init.d/aliyun-service start
    
    # Verify that the service has started. The service is running if the output is not empty.
    ps aux | grep -v grep | grep "aliyun-service"

Windows

Method 1: Use the Windows Services UI

  1. Use RDP client or Windows App.

  2. Click the Start icon and select Windows Administrative Tools > Computer Management.

  3. In the left pane, go to Computer Management (Local) > Services and Applications > Services.

  4. Find Aliyun Assist Service and click Start the service.

Method 2: Use Windows PowerShell

  1. Use RDP client or Windows App.

  2. Click the Start icon, find Windows PowerShell, right-click it, and select Run as administrator.

  3. Start Cloud Assistant Agent.

    Start-Service -Name "AliyunService"
  4. Verify that the agent has started.

    The agent is running if Status is Running.

    Get-Service -Name "AliyunService"

References