Manage viam-agent

viam-agent is installed as a systemd service named viam-agent.

  • To start viam-agent:

    sudo systemctl start viam-agent
    
  • To stop viam-agent:

    sudo systemctl stop viam-agent
    
  • To restart viam-agent:
sudo systemctl restart viam-agent
  • To completely uninstall viam-agent and viam-server, run the following command:

    sudo /bin/sh -c "$(curl -fsSL https://storage.googleapis.com/packages.viam.com/apps/viam-agent/uninstall.sh)"
    

    This command uninstalls viam-agent, viam-server, the machine cloud credentials file (/etc/viam.json), and the provisioning configuration file (/etc/viam-provisioning.json).

On Windows, you can manage viam-agent using the Services GUI or the command line:

  1. Open the Services management console from your computer’s start menu.

  2. Find viam-agent in the list of services.

    Windows Services manager with viam-agent highlighted.
  3. Use the Start Service, Stop Service, and Restart Service buttons to manage viam-agent.

  4. To change the startup type of viam-agent, right-click on viam-agent and select Properties. Select your desired startup type from the Startup type dropdown menu.

    Windows Services manager with viam-agent properties open.
  1. Open a PowerShell prompt, selecting Run as administrator.

  2. Use the following commands to manage viam-agent:

    • To start viam-agent:

      Start-Service viam-agent
      
    • To stop viam-agent:

      Stop-Service viam-agent
      
    • To restart viam-agent:

      Restart-Service viam-agent
      
    • To change the startup type of viam-agent, use one of the following commands:

      Set-Service -Name "viam-agent" -StartupType Manual
      Set-Service -Name "viam-agent" -StartupType Automatic
      

Troubleshooting

You can find assistance in the Troubleshooting section.