The Cloud Assistant client is an agent that runs Cloud Assistant scripts on ECS instances. This topic describes how to start or stop the Cloud Assistant client.

Prerequisites

You have installed the Cloud Assistant client. For more information, see Install the Cloud Assistant client.

Stop or start the client on a Windows instance

To start or stop the Cloud Assistant client on a Windows instance, follow these steps:

  1. Connect to the Windows ECS instance. For more information, see Connect to a Windows instance.
  2. Choose Computer Management > Services and Applications > Services and find AliyunService.
    Warning AliyunService is the process name of the Cloud Assistant client. If you stop AliyunService, the Cloud Assistant client also stops. This may result in an exception on the ECS instance, and you may be unable to stop the instance from the ECS console. Use caution when you stop AliyunService.
  3. Click Stop or Restart below AliyunService.
    Restart the service

Stop or start the client on a Linux instance

To start or stop the Cloud Assistant client on a Linux instance, follow these steps:

  1. Connect to the Linux ECS instance. For more information, see Connect to a Linux instance by using a password.
  2. Run the following command to check the version of the Cloud Assistant client:
    aliyun-service -v
    Note Cloud Assistant clients later than V1.0.1.308 are no longer managed by Agent Watch. Therefore, you need to determine the returned version of the Cloud Assistant client before you can decide which method is to be used to start or stop the Cloud Assistant client.
  3. Based on the version of your Cloud Assistant client, choose one of the following methods:
    • For Cloud Assistant clients V1.0.1.308 and earlier, run the following commands based on the init system of ECS instances.
      • For operating systems such as Debian, CentOS, and Red Hat:
        # Stop the Cloud Assistant client.
        systemctl stop agentwatch
        # Start the Cloud Assistant client.
        systemctl start agentwatch
      • For operating systems using other init systems:
        # Stop the Cloud Assistant client.
        chkconfig agentwatch off
        # Start the Cloud Assistant client.
        chkconfig agentwatch on
    • For Cloud Assistant clients later than V1.0.1.308, run the following commands based on the init system of ECS instances.
      • For Linux systems with new versions of Linux kernel, which typically use the systemd initialization process, perform the following operations:
        # Check whether your ECS instance uses the systemd initialization process. If a message is returned, systemd is used.
        strings /sbin/init | grep "/lib/system"
        # Stop the Cloud Assistant client.
        systemctl stop aliyun.service
        # Start the Cloud Assistant client.
        systemctl start aliyun.service
      • For Linux systems that run Ubuntu 14 or earlier and typically use the UpStart initialization process, perform the following operations:
        # Check whether your ECS instance uses the UpStart initialization process. If a message is returned, UpStart is used.
        strings /sbin/init | grep "upstart"
        # Stop the Cloud Assistant client.
        /sbin/initctl stop aliyun-service
        # Start the Cloud Assistant client.
        /sbin/initctl start aliyun-service
      • For Linux systems with earlier versions of Linux kernel, which typically use the sysvinit initialization process, perform the following operations:
        # Check whether your ECS instance uses the sysvinit initialization process. If a message is returned, sysvinit is used.
        strings /sbin/init | grep "sysvinit"
        # Stop the Cloud Assistant client.
        /etc/init.d/aliyun-service stop
        # Start the Cloud Assistant client.
        /etc/init.d/aliyun-service start