1
2
mirror of https://github.com/dali99/nixos-matrix-modules.git synced 2026-02-11 07:47:00 +01:00

Restart both main process and workers on unexpected exit

This commit is contained in:
2026-01-14 02:48:55 +09:00
parent 4c5ef718fe
commit 31baa00922
2 changed files with 10 additions and 1 deletions

View File

@@ -443,9 +443,14 @@ in
User = "matrix-synapse";
Group = "matrix-synapse";
Slice = "system-matrix-synapse.slice";
Restart = "always";
RestartSec = 3;
WorkingDirectory = cfg.dataDir;
StateDirectory = "matrix-synapse";
RuntimeDirectory = "matrix-synapse";
ExecStartPre = let
flags = lib.cli.toCommandLineShellGNU {} {
config-path = [ matrix-synapse-common-config ] ++ cfg.extraConfigFiles;
@@ -460,7 +465,6 @@ in
};
in "${wrapped}/bin/synapse_homeserver ${flags}";
ExecReload = "${lib.getExe' pkgs.coreutils "kill"} -HUP $MAINPID";
Restart = "on-failure";
CapabilityBoundingSet = [ "" ];
LockPersonality = true;

View File

@@ -395,9 +395,14 @@ in {
User = "matrix-synapse";
Group = "matrix-synapse";
Slice = "system-matrix-synapse.slice";
Restart = "always";
RestartSec = 3;
WorkingDirectory = cfg.dataDir;
RuntimeDirectory = "matrix-synapse";
StateDirectory = "matrix-synapse";
ExecStartPre = pkgs.writers.writeBash "wait-for-synapse" ''
# From https://md.darmstadt.ccc.de/synapse-at-work
while ! systemctl is-active -q matrix-synapse.service; do