<a id="startup-configuration"></a>

# Startup configuration

*halon-rated* loads the non-reloadable startup configuration is read from `/etc/halon/rated.yaml`.

Below are some of the most important settings that can be configured.

> **Note**
> 
> The example configuration in  */opt/halon/share/examples/* that is usually copied
> to  */etc/halon/* during installation contains reasonable defaults.
> Normally you only need to modify the secret key to use.

<a id="listener-directives"></a>

## Listener directives

<a id="confval-listen.port"></a>

### listen.port

Which TCP port to listen on. The default is `13131`.

<a id="confval-listen.address"></a>

### listen.address

IPv4 or IPv6 address to listen on.
The default is to listen to all IPv4 and IPv6 addresses.

<a id="clustering-directives"></a>

## Clustering directives

<a id="confval-key"></a>

### key

A HMAC-SHA1 key used for rate synchronization between `rated` instances in HEX format.

> ```yaml
> key: a3faf19660fea508afaab8648b4aa3b9f685acd0 # do not use this specific key
> ```

<a id="confval-syncdelay"></a>

### syncdelay

The microseconds delay between sending rate packages. This prevents network overload when doing UDP synchronization. The default is `25` microseconds. This allows 40’000 PPS.

<a id="confval-reresolve"></a>

### reresolve

Automatically re-resolve the hostnames of the synchronization peers (as specific in rated-app.yaml) every x seconds (The default is to never re-resolve the hostnames of the synchronization peers automatically)

<a id="environment-directives"></a>

## Environment directives

The default startup configuration that came with the installation package
contains reasonable defaults for your platform. Some settings should however
be revised.

<a id="configuration-paths"></a>

### Configuration paths

Those paths can normally be left unchanged.

<a id="confval-environment.appconf"></a>

#### environment.appconf

From where to load the [running configuration](config_rated_app.html.md).
The default is  */etc/halon/rated-app.yaml*.

<a id="other-environment"></a>

### Other environment

Those settings should normally be left unchanged.
The default startup configuration in  */opt/halon/examples*
that came with the installation package should contain
correct parameters for your operating system or distribution.

<a id="confval-environment.socket.path"></a>

#### environment.socket.path

Have the API socket on a UNIX socket. This option is mutually exclusive with the [`environment.controlsocket.port`](#confval-environment.controlsocket.port) setting. The default is `/var/run/halon/rated.sock`.

<a id="confval-environment.socket.owner"></a>

#### environment.socket.owner

This option is only supported with the [`environment.socket.path`](#confval-environment.socket.path) setting.

<a id="confval-environment.socket.group"></a>

#### environment.socket.group

This option is only supported with the [`environment.socket.path`](#confval-environment.socket.path) setting.

<a id="confval-environment.socket.chmod"></a>

#### environment.socket.chmod

This option is only supported with the [`environment.socket.path`](#confval-environment.socket.path) setting.

<a id="confval-environment.controlsocket.path"></a>

#### environment.controlsocket.path

Have the control socket on a UNIX socket. This option is mutually exclusive with the [`environment.controlsocket.port`](#confval-environment.controlsocket.port) setting. The default is `/var/run/halon/rated.ctl`.

<a id="confval-environment.controlsocket.owner"></a>

#### environment.controlsocket.owner

This option is only supported with the [`environment.controlsocket.path`](#confval-environment.controlsocket.path) setting.

<a id="confval-environment.controlsocket.group"></a>

#### environment.controlsocket.group

This option is only supported with the [`environment.controlsocket.path`](#confval-environment.controlsocket.path) setting.

<a id="confval-environment.controlsocket.chmod"></a>

#### environment.controlsocket.chmod

This option is only supported with the [`environment.controlsocket.path`](#confval-environment.controlsocket.path) setting.

<a id="confval-environment.controlsocket.port"></a>

#### environment.controlsocket.port

Have the control socket on a TCP port. This option is mutually exclusive with the [`environment.controlsocket.path`](#confval-environment.controlsocket.path) setting.

<a id="confval-environment.controlsocket.address"></a>

#### environment.controlsocket.address

Have the control socket listen on a specific IP address. This option is only supported with the [`environment.controlsocket.port`](#confval-environment.controlsocket.port) setting.

<a id="confval-environment.privdrop.user"></a>

#### environment.privdrop.user

The user to run the process as.

<a id="confval-environment.privdrop.group"></a>

#### environment.privdrop.group

The group to run the process as.

> **Tip**
> 
> The `privdrop.user` and `privdrop.group` settings to use will depend on your Linux distribution:
> 
> * For Ubuntu, suitable values are `nobody` and `nogroup`
> * For RHEL and related distibutions, the values are `nobody` and `nobody`.
> 
> After installation, directory  */opt/halon/share/examples/minimal/config/rated.yaml* on your host contains an example.
