git.iko.soy/typeable/nixpkgs
on master help sign in
apply 'restartIfChanged = false' to all libvirtd services

Although it is quite safe to restart ```libvirtd``` when there are only ```qemu``` machines, in case if there are ```libvirt_lxc``` containers, a restart may result in putting the whole system into an odd state: the containers go on running but the new ```libvirtd``` daemons do not see them.

commit15351c478046935ae4a5504d492c7db1ad0fa31e authorvolth <volth@webmaster.ms> dateThu 10 Aug 2017, 11:34 (9 years ago) parent2dddc6d
1 file changed+4−1
nixos/modules/virtualisation/libvirtd.nix+4−1
nixos/modules/virtualisation/libvirtd.nix+4−1
@@ -168,8 +168,9 @@ in {
168168 serviceConfig = {
169169 Type = "notify";
170170 KillMode = "process"; # when stopping, leave the VMs alone
171− Restart = "on-failure";
171+ Restart = "no";
172172 };
173+ restartIfChanged = false;
173174 };
174175
175176 systemd.services.libvirt-guests = {
@@ -187,6 +188,7 @@ in {
187188 systemd.services.virtlogd = {
188189 description = "Virtual machine log manager";
189190 serviceConfig.ExecStart = "@${pkgs.libvirt}/sbin/virtlogd virtlogd";
191+ restartIfChanged = false;
190192 };
191193
192194 systemd.sockets.virtlockd = {
@@ -198,6 +200,7 @@ in {
198200 systemd.services.virtlockd = {
199201 description = "Virtual machine lock manager";
200202 serviceConfig.ExecStart = "@${pkgs.libvirt}/sbin/virtlockd virtlockd";
203+ restartIfChanged = false;
201204 };
202205 };
203206}