From e026d5b9c813084d029382f3af72a57e3142fae1 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Mon, 10 Oct 2016 21:35:37 +0100 Subject: [PATCH] x11 module: don't restart the display manager indefinitely (#19418) * 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. * x11 module: fix display manager restart timeouts It takes more than 1 second to boot the X server. --- 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 ec2f3a4f8bb1..e34f0c216639 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -539,6 +539,10 @@ in Restart = "always"; RestartSec = "200ms"; SyslogIdentifier = "display-manager"; + # Stop restarting if the display manager stops (crashes) 2 times + # in one minute. Starting X typically takes 3-4s. + StartLimitInterval = "30s"; + StartLimitBurst = "3"; }; };