mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
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
This commit is contained in:
parent
be075ed348
commit
eba686ddfa
1 changed files with 17 additions and 0 deletions
|
@ -256,6 +256,10 @@ let
|
||||||
RestartForceExitStatus = "133";
|
RestartForceExitStatus = "133";
|
||||||
SuccessExitStatus = "133";
|
SuccessExitStatus = "133";
|
||||||
|
|
||||||
|
# Some containers take long to start
|
||||||
|
# especially when you automatically start many at once
|
||||||
|
TimeoutStartSec = cfg.timeoutStartSec;
|
||||||
|
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
|
|
||||||
Slice = "machine.slice";
|
Slice = "machine.slice";
|
||||||
|
@ -423,6 +427,7 @@ let
|
||||||
extraVeths = {};
|
extraVeths = {};
|
||||||
additionalCapabilities = [];
|
additionalCapabilities = [];
|
||||||
ephemeral = false;
|
ephemeral = false;
|
||||||
|
timeoutStartSec = "15s";
|
||||||
allowedDevices = [];
|
allowedDevices = [];
|
||||||
hostAddress = null;
|
hostAddress = null;
|
||||||
hostAddress6 = 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 {
|
bindMounts = mkOption {
|
||||||
type = with types; loaOf (submodule bindMountOpts);
|
type = with types; loaOf (submodule bindMountOpts);
|
||||||
default = {};
|
default = {};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue