Skip to content

Operations and Deployment

iliyan85 edited this page Jul 5, 2026 · 1 revision

Operations and Deployment

This page describes current runtime behavior. It does not replace the main repository README as the quick-start guide.

Configuration Lookup

AISMixer loads its active configuration in this order:

  1. /etc/aismixer/config.yaml when present.
  2. config.yaml in the current working directory otherwise.

Example files in the main repository are inactive until an operator copies or adapts them. Direct routing update files used with aismixerctl replace --file are not full runtime configs.

Starting AISMixer

From a repository checkout or copied service directory:

python3 aismixer.py

The main repository also contains the existing install.sh and systemd path. The current installer path does not automatically provision the control socket runtime directory, and it does not provide a global aismixerctl wrapper.

Control Socket Deployment

Runtime routing control is explicit opt-in:

control:
  unix:
    enabled: true
    socket_path: /run/aismixer/control.sock
    socket_mode: "0660"

The parent directory for socket_path must already exist. For /run/aismixer/control.sock, the /run/aismixer directory is operator-managed today.

Choose directory ownership, group, and socket mode for the local deployment. For example, use placeholders such as <service-user> and <operator-group> in deployment notes rather than assuming a project-defined account.

When control.unix.enabled: true is configured and the socket cannot bind, startup fails instead of silently running without the requested control interface.

Shutdown and Cleanup

On normal shutdown paths, AISMixer cancels runtime tasks, closes UDP listener sockets, and closes the control server if it was started. KeyboardInterrupt exits the foreground process cleanly.

Routing Lifecycle

Static routing is loaded from the active configuration file at process startup. If the config contains a valid routing: section, the process starts in routing mode. Without an active routing table, it uses legacy broadcast mode.

Runtime replacements are process-local and non-persistent. A successful routing.replace or routing.disable changes the running process only. Restarting AISMixer restores routing from the active config file.

Generation Workflow

Check the current state:

python3 aismixerctl.py --socket /run/aismixer/control.sock status

Replace the active process-local routing snapshot:

python3 aismixerctl.py --socket /run/aismixer/control.sock replace --file examples/routing-update.yaml --expected-generation 3

Disable runtime routing and return to legacy broadcast mode:

python3 aismixerctl.py --socket /run/aismixer/control.sock disable --expected-generation 4

expected_generation protects against accidental stale updates. If another update has already changed the generation, the server rejects the request with stale_generation; fetch fresh status before trying again.

Rollback Options

To roll back a runtime routing change, replace using a previously saved routing file:

python3 aismixerctl.py --socket /run/aismixer/control.sock replace --file previous-routing.yaml --expected-generation 5

To stop routing immediately, disable it:

python3 aismixerctl.py --socket /run/aismixer/control.sock disable --expected-generation 5

There is no persistent routing rollback history. Keep your own reviewed routing files when rollback matters.

See Runtime Routing Control, Configuration Reference, and Known Limitations.

Clone this wiki locally