Skip to content

Service Management

Use this page to operate the collector as a background Linux service.

  • Linux host with systemd
  • Root privileges (sudo)
  • Stable config file path (absolute path recommended)

Store the license in a root-owned path that the service can always read:

Terminal window
sudo mkdir -p /etc/ms-teams-observability-agent
sudo cp ./license.lic /etc/ms-teams-observability-agent/license.lic
sudo chmod 640 /etc/ms-teams-observability-agent/license.lic

Set the same absolute path in your config:

collection_config:
license_file: /etc/ms-teams-observability-agent/license.lic
Terminal window
sudo ./ms-teams-agent.bin --config /absolute/path/to/config.yaml --enable_boot_start
Terminal window
sudo ./ms-teams-agent.bin --config /path/to/config-prod.yaml --enable_boot_start --service_name_suffix=-prod
sudo ./ms-teams-agent.bin --config /path/to/config-staging.yaml --enable_boot_start --service_name_suffix=-staging
Terminal window
# Check service status
sudo systemctl status <service_name>
# Follow live logs
sudo journalctl -u <service_name> -f
# Restart service after config change
sudo systemctl restart <service_name>
  1. Back up the current config.

  2. Update config values.

  3. Restart the service:

    Terminal window
    sudo systemctl restart <service_name>
  4. Verify status and recent logs:

    Terminal window
    sudo systemctl status <service_name>
    sudo journalctl -u <service_name> -n 50

If a service with the same name already exists, force recreation:

Terminal window
sudo ./ms-teams-agent.bin --config /absolute/path/to/config.yaml --enable_boot_start --force_service_creation
Terminal window
sudo ./ms-teams-agent.bin --config /absolute/path/to/config.yaml --disable_boot_start

This stops and removes the systemd service.