From ecf9befc32b830ba78947af786061833c8b9a894 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 10 Feb 2026 16:23:09 +0200 Subject: [PATCH] Adapt to the `all-at-once` restart mode default in systemd_service_manager v2.0.0-0 - `install-service` no longer forces `one-by-one` restart mode - the coturn priority condition is flipped: only `one-by-one` mode needs the delayed priority (1500); all other modes (including the new `all-at-once` default) use the normal priority (900) Ref: - https://github.com/devture/com.devture.ansible.role.systemd_service_manager/commit/d42cd9204548d47c1368badc9b152f4261093398 - https://github.com/devture/com.devture.ansible.role.systemd_service_manager/blob/f3e658cca3b41d3aedc81aa77cf22bafd9ca4d0f/docs/restart-mode-comparison.md - https://github.com/devture/com.devture.ansible.role.systemd_service_manager/commit/36445fb41931c6baa3c44818877def4a162e5db4 - 750cb7e29eb2346882c627a485218749b55a963d --- group_vars/matrix_servers | 6 ++++-- justfile | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 932984abc..593fc137b 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -238,12 +238,14 @@ matrix_addons_homeserver_systemd_services_list: "{{ ([traefik_identifier + '.ser # (see `matrix_playbook_internal_matrix_client_api_traefik_entrypoint_enabled`) # - core services (the homeserver) get a level of ~1000 # - services that the homeserver depends on (database, Redis, ntfy, coturn, etc.) get a lower level — between 500 and 1000 -# - coturn gets a higher level if `devture_systemd_service_manager_service_restart_mode == 'one-by-one'` to intentionally delay it, because: +# - coturn gets a higher priority level (= starts later) if `devture_systemd_service_manager_service_restart_mode == 'one-by-one'` to intentionally delay it, because: # - starting services one by one means that the service manager role waits for each service to fully start before proceeding to the next one # - if coturn has a lower priority than the homeserver, it would be started before it # - since coturn is started before the homeserver, there's no container label telling Traefik to get a `matrix.example.com` certificate # - thus, coturn would spin and wait for a certificate until it fails. We'd get a playbook failure due to it, but service manager will proceed to start all other services anyway. # - only later, when the homeserver actually starts, would that certificate be fetched and dumped +# - this is not a problem with `all-at-once` (default) or `priority-batched` (services start concurrently), +# or with `clean-stop-start` (everything stops first, then starts in priority order — coturn at 900 is fine) # - reverse-proxying services get level 3000 # - Matrix utility services (bridges, bots) get a level of 2000/2200, so that: # - they can start before the reverse-proxy @@ -352,7 +354,7 @@ devture_systemd_service_manager_services_list_auto: | + ([{'name': 'matrix-corporal.service', 'priority': 1500, 'groups': ['matrix', 'corporal']}] if matrix_corporal_enabled else []) + - ([{'name': 'matrix-coturn.service', 'priority': (900 if devture_systemd_service_manager_service_restart_mode == 'clean-stop-start' else 1500), 'groups': ['matrix', 'coturn']}] if matrix_coturn_enabled else []) + ([{'name': 'matrix-coturn.service', 'priority': (1500 if devture_systemd_service_manager_service_restart_mode == 'one-by-one' else 900), 'groups': ['matrix', 'coturn']}] if matrix_coturn_enabled else []) + ([{'name': 'matrix-matrixto.service', 'priority': 4000, 'groups': ['matrix', 'matrixto']}] if matrix_matrixto_enabled else []) + diff --git a/justfile b/justfile index b44ac9b4f..dc54828fc 100644 --- a/justfile +++ b/justfile @@ -50,8 +50,7 @@ install-all *extra_args: (run-tags "install-all,ensure-matrix-users-created,star install-service service *extra_args: {{ just_executable() }} --justfile "{{ justfile() }}" run \ --tags=install-{{ service }},start-group \ - --extra-vars=group={{ service }} \ - --extra-vars=devture_systemd_service_manager_service_restart_mode=one-by-one {{ extra_args }} + --extra-vars=group={{ service }} {{ extra_args }} # Runs the playbook with --tags=setup-all,ensure-matrix-users-created,start and optional arguments setup-all *extra_args: (run-tags "setup-all,ensure-matrix-users-created,start" extra_args)