diff options
author | davidak <git@davidak.de> | 2019-07-31 16:19:18 +0200 |
---|---|---|
committer | davidak <git@davidak.de> | 2019-08-28 14:54:51 +0200 |
commit | eba686ddfad91d8f59d61e3ca0e26f1360ff9a81 (patch) | |
tree | 242d2159bf51c4255ce64c5c07533ad72cf30759 /nixos/modules/virtualisation | |
parent | be075ed348dfbddeefdb8cdd57fc5cb443a4337e (diff) |
nixos-containers: add TimeoutStartSec option
Default is now 1m instead of global default of 15sec. It is also
configurable.
Fixes issue where start of many containers (40+) fail
https://github.com/NixOS/nixpkgs/issues/65001
Diffstat (limited to 'nixos/modules/virtualisation')
-rw-r--r-- | nixos/modules/virtualisation/containers.nix | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/nixos/modules/virtualisation/containers.nix b/nixos/modules/virtualisation/containers.nix index b65374c9257..b61558b2201 100644 --- a/nixos/modules/virtualisation/containers.nix +++ b/nixos/modules/virtualisation/containers.nix @@ -256,6 +256,10 @@ let RestartForceExitStatus = "133"; SuccessExitStatus = "133"; + # Some containers take long to start + # especially when you automatically start many at once + TimeoutStartSec = cfg.timeoutStartSec; + Restart = "on-failure"; Slice = "machine.slice"; @@ -423,6 +427,7 @@ let extraVeths = {}; additionalCapabilities = []; ephemeral = false; + timeoutStartSec = "15s"; allowedDevices = []; hostAddress = null; hostAddress6 = null; @@ -595,6 +600,18 @@ in ''; }; + timeoutStartSec = mkOption { + type = types.str; + default = "1min"; + description = '' + Time for the container to start. In case of a timeout, + the container processes get killed. + See <citerefentry><refentrytitle>systemd.time</refentrytitle> + <manvolnum>7</manvolnum></citerefentry> + for more information about the format. + ''; + }; + bindMounts = mkOption { type = with types; loaOf (submodule bindMountOpts); default = {}; |