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:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user