From 07b844265646ffce5f1ff33efa88aec3e2f3642f Mon Sep 17 00:00:00 2001 From: zimbatm Date: Mon, 10 Oct 2016 09:22:04 +0100 Subject: [PATCH] x11 module: don't restart the display manager indefinitely If the display managers crashes continuously in loops it prevents the user from switching to the console and try to fix things. Especially when using the "auto" display manager it can happen quite easily. --- nixos/modules/services/x11/xserver.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index 6c6a1e79ed0e..61308f7d1287 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -529,6 +529,10 @@ in Restart = "always"; RestartSec = "200ms"; SyslogIdentifier = "display-manager"; + # Stop restarting if the display manager stops (crashes) 3 times + # in 3 seconds. + StartLimitInterval = "3s"; + StartLimitBurst = "3"; }; };