-
Single Entry Point
Provides a unified interface for all utility functions (database checks, maintenance tasks, etc.). -
One Binary
Replaces a bunch of shell scripts with a single executable, centralizing logic in one place. -
Declarative Configuration
Uses a YAML‑based config to declare versions, paths, and overrides, making behavior transparent and easy to manage. -
Service‑Ready & UI‑Friendly
Can run as a long‑running service and expose a consistent API for integration with web dashboards or other user interfaces.
This section describes how ad-runtime-utils chooses the correct installation path for a given runtime (Java, Python, etc.), both when a service is specified and in the default (no-service) case.
-
Service override_path
- If
services.<NAME>.runtimes.<RT>.override_pathis set and<path>/bin/<exe>exists → return that path.
- If
-
Service env_var
- If
services.<NAME>.runtimes.<RT>.env_varis set, and the named environment variable is non-empty and points at a valid<path>/bin/<exe>→ return its value.
- If
-
Service version
- Read
services.<NAME>.runtimes.<RT>.version. - If missing or empty → error:
version not specified for service '<NAME>' runtime '<RT>'
- Read
-
Per-version Autodetect (
autodetect.runtimes.<RT>.<version>)- If
override_pathis set and valid → return it. - If
env_varis set and points at a valid path → return it. - Otherwise, for each glob in
paths(in order):candidates := Glob(pattern + "*")- sort in reverse lexical order
- first candidate with
<cand>/bin/<exe>→ return that path.
- If
-
Fallback to Default-Flow
- If none of the above steps succeed, repeat the Default-Flow (see below), but format output as:
<NAME>: /path/from/default-flow
- If none of the above steps succeed, repeat the Default-Flow (see below), but format output as:
-
Error
- If still nothing is found →
no <RT> environment found for service '<NAME>' (version '<version>')
- If still nothing is found →
-
Default override_path
- If
default.runtimes.<RT>.override_pathis set and valid → return it.
- If
-
Default env_var
- If
default.runtimes.<RT>.env_varis set and points at a valid path → return it.
- If
-
Default version
- Read
default.runtimes.<RT>.version. - If missing or empty → error:
default version not specified for runtime '<RT>'
- Read
-
Per-version Autodetect (
autodetect.runtimes.<RT>.<version>)- Same 4.1–4.3 as in the Service-Specific Flow.
-
Error
When the --list (or -l) flag is provided:
It outputs all detected runtimes for:
- The default configuration
- Each defined service
Default runtimes:
<runtime>: <path or "error: <message>">
Service <service-name>:
<runtime>: <path or "error: <message>">
…
When --start and/or --supervise flags are provided --service is a required argument.
-
It starts the executable
services.<service-name>.executablewith the specified arguments fromservices.<service-name>.executable_args. -
If the
--superviseflag is provided, it will run the health checks, defined inservices.<service-name>.health_checkson service start to make sure the service is operational. If any of the checks fail the service will be stopped.Type=notifyshould be used in the systemd unit(see example inexamples/systemddirectory). -
While using
--superviseand health checks, make sure that systemd service has enoughTimeoutStartSec. ideally should be a combined timeout of all health checks.