forked from mirrors/nixpkgs
Merge pull request #48640 from gnidorah/kvmgt
kvmgt module: add restart on failure
This commit is contained in:
commit
e37892744f
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue