kvmgt module: add service restart on failure
This commit is contained in:
parent
32bcd72bf2
commit
a6603fd8a8
@ -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 New Issue
Block a user