From 9d6c8eabcbad06a4236054b9041491e1e293250d Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Wed, 11 Feb 2026 18:53:40 +0200 Subject: [PATCH] Fix swapped Requires=/Wants= directives in Draupnir and Mjolnir systemd service templates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 593b3157b ("Fix systemd service Wants for mjolnir and draupnir") accidentally swapped the variable loops: `systemd_wanted_services_list` ended up generating `Requires=`/`After=` directives and `systemd_required_services_list` ended up generating `Wants=` directives — the opposite of what the variable names mean and how every other bot/bridge service template in the playbook works. This caused these bots to only `Wants=` (not `Requires=`/`After=`) their dependencies like matrix-traefik.service, so systemd didn't guarantee ordering. During all-at-once restarts, the bots would start before traefik was ready, fail with DNS resolution errors, and crash. Co-Authored-By: Claude Opus 4.6 --- .../templates/systemd/matrix-bot-draupnir.service.j2 | 4 ++-- .../templates/systemd/matrix-bot-mjolnir.service.j2 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/custom/matrix-bot-draupnir/templates/systemd/matrix-bot-draupnir.service.j2 b/roles/custom/matrix-bot-draupnir/templates/systemd/matrix-bot-draupnir.service.j2 index e54f1c7d0..2874106ef 100644 --- a/roles/custom/matrix-bot-draupnir/templates/systemd/matrix-bot-draupnir.service.j2 +++ b/roles/custom/matrix-bot-draupnir/templates/systemd/matrix-bot-draupnir.service.j2 @@ -1,11 +1,11 @@ #jinja2: lstrip_blocks: True [Unit] Description=Matrix Draupnir bot -{% for service in matrix_bot_draupnir_systemd_wanted_services_list %} +{% for service in matrix_bot_draupnir_systemd_required_services_list %} Requires={{ service }} After={{ service }} {% endfor %} -{% for service in matrix_bot_draupnir_systemd_required_services_list %} +{% for service in matrix_bot_draupnir_systemd_wanted_services_list %} Wants={{ service }} {% endfor %} DefaultDependencies=no diff --git a/roles/custom/matrix-bot-mjolnir/templates/systemd/matrix-bot-mjolnir.service.j2 b/roles/custom/matrix-bot-mjolnir/templates/systemd/matrix-bot-mjolnir.service.j2 index 9c2933489..b4687cb75 100644 --- a/roles/custom/matrix-bot-mjolnir/templates/systemd/matrix-bot-mjolnir.service.j2 +++ b/roles/custom/matrix-bot-mjolnir/templates/systemd/matrix-bot-mjolnir.service.j2 @@ -1,11 +1,11 @@ #jinja2: lstrip_blocks: True [Unit] Description=Matrix Mjolnir bot -{% for service in matrix_bot_mjolnir_systemd_wanted_services_list %} +{% for service in matrix_bot_mjolnir_systemd_required_services_list %} Requires={{ service }} After={{ service }} {% endfor %} -{% for service in matrix_bot_mjolnir_systemd_required_services_list %} +{% for service in matrix_bot_mjolnir_systemd_wanted_services_list %} Wants={{ service }} {% endfor %} DefaultDependencies=no