Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
kvmgt module: add service restart on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
gnidorah committed Oct 18, 2018
1 parent 32bcd72 commit a6603fd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion nixos/modules/virtualisation/kvmgt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a6603fd

Please sign in to comment.