uvms-guest: select() to detect dead subprocesses
This commit is contained in:
parent
dd6609ba3f
commit
00ae88e8ad
3 changed files with 127 additions and 70 deletions
|
|
@ -39,9 +39,9 @@ in
|
|||
./on-failure.nix
|
||||
];
|
||||
config = {
|
||||
some.failure-handler.enable = true;
|
||||
# some.failure-handler.enable = true;
|
||||
hardware.graphics.enable = true;
|
||||
# boot.kernelPackages = pkgs.linuxPackagesFor uvmsPkgs.linux-uvm;
|
||||
boot.kernelPackages = pkgs.linuxPackagesFor uvmsPkgs.linux-uvm;
|
||||
# boot.isContainer = true;
|
||||
boot.initrd.kernelModules = [
|
||||
"drm"
|
||||
|
|
@ -256,14 +256,26 @@ in
|
|||
partOf = [ "uvms-guest.service" ];
|
||||
};
|
||||
systemd.services."uvms-guest" = {
|
||||
requiredBy = [ "multi-user.target" ];
|
||||
onFailure = [ "shutdown.service" ];
|
||||
serviceConfig = {
|
||||
User = "user";
|
||||
Group = "users";
|
||||
ExecStart = "${lib.getExe uvmsPkgs.uvms-guest}";
|
||||
ExecStop = [
|
||||
"/run/current-system/sw/bin/echo GUEST DOWN"
|
||||
"/run/current-system/sw/bin/systemctl poweroff"
|
||||
];
|
||||
StandardOutput = "journal+console";
|
||||
StandardError = "journal+console";
|
||||
Restart = "no";
|
||||
};
|
||||
};
|
||||
systemd.services."shutdown" = {
|
||||
serviceConfig = {
|
||||
ExecStart = [ "/run/current-system/sw/bin/systemctl poweroff" ];
|
||||
StandardOutput = "journal+console";
|
||||
StandardError = "journal+console";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -371,7 +383,7 @@ in
|
|||
options = {
|
||||
size = mkOption {
|
||||
type = types.int;
|
||||
default = 1536 * 1048576;
|
||||
default = 3 * 1024 * 1048576;
|
||||
};
|
||||
shared = mkOption {
|
||||
type = types.bool;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue