tree: 597b76caed23b7d80d62adc65050c07a366ed978 [path history] [tgz]
  1. .coveragerc
  9. test/

Service Manager

The service_manager starts, monitors and stops long-running processes on the machine.

Services are configured with JSON config files in /etc/infra-services. or C:/chrome-infra/service-config on Windows.

Each config file defines one service. A service will be started immediately when its config file is added to that directory, will be stopped when the config is removed, and will be restarted when the config is changed.

The config file contains a JSON object with the following fields:

  • name - A short friendly name for the service.

  • working_directory - (optional) The working directory where a given service starts.

  • cmd - A list with the command to run and arguments for a given service.

  • stop_time - (optional, default 10 seconds) Number of seconds to give the service to shut itself down after receiving a SIGTERM. service_manager will send a SIGKILL after this time if the service is still running.

  • environment - (optional) a dict with a list of environment variables to override: {name: value}. Note that name and value must be a string.

  • resources - (optional) a dict with a list of resource limits in the following format. This field is ignored in windows. { “resource”: [softlimit, hardlimit], “resource1”: [softlimit, hardlimit], “resource2”: [], ... }

                  The following resources are supported in this field, and
                  a value with an empty array indicates that there is no limit
                  for a given resource. To get more information, please visit
                  the following page:
                  "cpu"           : The maximum amount of processor time
                                    (in seconds).
                  "memory"        : The maximum area (in bytes) of address
                  "num_files"     : The maximum number of open file
                  "num_processes" : The maximum number of processes it may
                  "stack"         : The maximum size (in bytes) of the call
    • cipd_version_file - Path to a CIPD version file to monitor for changes. The service will be restarted when a new version is detected.


  "name": "mastermon",
  "working_directory": "/opt/infra-python",
  "cmd": [ "/opt/infra-python/", "" ],
  "args": [
    "--url", "",
    "--ts-mon-endpoint", "file:///tmp/metrics"
  "stop_time": 5