3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #48640 from gnidorah/kvmgt

kvmgt module: add restart on failure
This commit is contained in:
Jörg Thalheim 2018-10-19 10:45:04 +01:00 committed by GitHub
commit e37892744f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;