diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2018-10-19 10:45:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-19 10:45:04 +0100 |
commit | e37892744f4ee0b938400b691b7de671042fd391 (patch) | |
tree | ee004b4136b7ee1283c7c561dd43cb8888674197 /nixos | |
parent | 4a36eeb9d44dc164cf44f275b7fc81adff03e778 (diff) | |
parent | a6603fd8a8a058e957fd5cc17302f3efb6c9b839 (diff) | |
download | nixpkgs-e37892744f4ee0b938400b691b7de671042fd391.tar nixpkgs-e37892744f4ee0b938400b691b7de671042fd391.tar.gz nixpkgs-e37892744f4ee0b938400b691b7de671042fd391.tar.bz2 nixpkgs-e37892744f4ee0b938400b691b7de671042fd391.tar.lz nixpkgs-e37892744f4ee0b938400b691b7de671042fd391.tar.xz nixpkgs-e37892744f4ee0b938400b691b7de671042fd391.tar.zst nixpkgs-e37892744f4ee0b938400b691b7de671042fd391.zip |
Merge pull request #48640 from gnidorah/kvmgt
kvmgt module: add restart on failure
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/virtualisation/kvmgt.nix | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/nixos/modules/virtualisation/kvmgt.nix b/nixos/modules/virtualisation/kvmgt.nix index fc0bedb68bd..132815a0ad6 100644 --- a/nixos/modules/virtualisation/kvmgt.nix +++ b/nixos/modules/virtualisation/kvmgt.nix @@ -50,11 +50,17 @@ in { nameValuePair "kvmgt-${name}" { description = "KVMGT VGPU ${name}"; serviceConfig = { - Type = "oneshot"; + Type = "forking"; RemainAfterExit = true; + Restart = "on-failure"; + RestartSec = 5; ExecStart = "${pkgs.runtimeShell} -c 'echo ${value.uuid} > /sys/bus/pci/devices/${cfg.device}/mdev_supported_types/${name}/create'"; ExecStop = "${pkgs.runtimeShell} -c 'echo 1 > /sys/bus/pci/devices/${cfg.device}/${value.uuid}/remove'"; }; + unitConfig = { + StartLimitBurst = 5; + StartLimitIntervalSec = 30; + }; wantedBy = [ "multi-user.target" ]; } ) cfg.vgpus; |