mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-10-21 04:42:07 +03:00
* Only stop libvirt-guests automatically on system shutdown.
Saving/restoring VMs is disruptive. svn path=/nixos/trunk/; revision=33844
This commit is contained in:
parent
0cb5673400
commit
43f43fd185
@ -53,6 +53,7 @@ in
|
|||||||
{ description = "Libvirtd virtual machine management daemon";
|
{ description = "Libvirtd virtual machine management daemon";
|
||||||
|
|
||||||
startOn = "stopped udevtrigger";
|
startOn = "stopped udevtrigger";
|
||||||
|
stopOn = "";
|
||||||
|
|
||||||
path =
|
path =
|
||||||
[ pkgs.bridge_utils pkgs.dmidecode pkgs.dnsmasq
|
[ pkgs.bridge_utils pkgs.dmidecode pkgs.dnsmasq
|
||||||
@ -98,16 +99,15 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
# !!! Split this into save and restore tasks.
|
# !!! Split this into save and restore tasks.
|
||||||
jobs.libvirt_guests =
|
jobs."libvirt-guests" =
|
||||||
{ name = "libvirt-guests";
|
{ description = "Job to save/restore libvirtd VMs";
|
||||||
|
|
||||||
description = "Job to save/restore libvirtd VMs";
|
|
||||||
|
|
||||||
startOn = "started libvirtd";
|
startOn = "started libvirtd";
|
||||||
|
|
||||||
# We want to suspend VMs only on shutdown, but Upstart is broken.
|
# We want to suspend VMs only on shutdown, but Upstart is broken.
|
||||||
#stopOn = "starting shutdown and stopping libvirtd";
|
stopOn = "";
|
||||||
stopOn = "stopping libvirtd";
|
|
||||||
|
restartIfChanged = false;
|
||||||
|
|
||||||
path = [ pkgs.gettext pkgs.libvirt pkgs.gawk ];
|
path = [ pkgs.gettext pkgs.libvirt pkgs.gawk ];
|
||||||
|
|
||||||
@ -122,6 +122,18 @@ in
|
|||||||
respawn = false;
|
respawn = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
jobs."stop-libvirt" =
|
||||||
|
{ description = "Helper task to stop libvirtd and libvirt-guests on shutdown";
|
||||||
|
task = true;
|
||||||
|
restartIfChanged = false;
|
||||||
|
startOn = "starting shutdown";
|
||||||
|
script =
|
||||||
|
''
|
||||||
|
stop libvirt-guests || true
|
||||||
|
stop libvirtd || true
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user