From 20b853282248bf5f1343b09dd3cf07c296144b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 10 Jan 2025 12:14:04 +0100 Subject: [PATCH 1/2] create synapse registration in systemd service instead of systemd.tmpfiles --- clanModules/matrix-synapse/default.nix | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/clanModules/matrix-synapse/default.nix b/clanModules/matrix-synapse/default.nix index cf66a8db3..f20f88424 100644 --- a/clanModules/matrix-synapse/default.nix +++ b/clanModules/matrix-synapse/default.nix @@ -106,17 +106,6 @@ in }; }; - systemd.tmpfiles.settings."01-matrix" = { - "/run/synapse-registration-shared-secret" = { - C.argument = - config.clan.core.facts.services.matrix-synapse.secret.synapse-registration_shared_secret.path; - z = { - mode = "0400"; - user = "matrix-synapse"; - }; - }; - }; - clan.postgresql.users.matrix-synapse = { }; clan.postgresql.databases.matrix-synapse.create.options = { TEMPLATE = "template0"; @@ -169,8 +158,14 @@ in in { path = [ pkgs.curl ]; + serviceConfig.ExecStartPre = lib.mkBefore [ + "+${pkgs.coreutils}/bin/install -o matrix-synapse -g matrix-synapse ${ + lib.escapeShellArg + config.clan.core.facts.services.matrix-synapse.secret."synapse-registration_shared_secret".path + } /run/synapse-registration-shared-secret" + ]; serviceConfig.ExecStartPost = [ - (''+${pkgs.writeShellScript "matrix-synapse-create-users" usersScript}'') + ''+${pkgs.writeShellScript "matrix-synapse-create-users" usersScript}'' ]; }; From fe80e3c63035eb81cfcb146c820c44c0a945775e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 10 Jan 2025 12:23:52 +0100 Subject: [PATCH 2/2] container-driver: also include journal/systemd status --- checks/lib/container-driver/test_driver/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/checks/lib/container-driver/test_driver/__init__.py b/checks/lib/container-driver/test_driver/__init__.py index a74fab7b4..e5beebc4b 100644 --- a/checks/lib/container-driver/test_driver/__init__.py +++ b/checks/lib/container-driver/test_driver/__init__.py @@ -253,7 +253,9 @@ class Machine: info = self.get_unit_info(unit) state = info["ActiveState"] if state == "failed": - msg = f'unit "{unit}" reached state "{state}"' + proc = self.systemctl(f"--lines 0 status {unit}") + journal = self.execute(f"journalctl -u {unit} --no-pager") + msg = f'unit "{unit}" reached state "{state}":\n{proc.stdout}\n{journal.stdout}' raise Error(msg) if state == "inactive":