From 1b54e48561c09219bfec7e73636bd999014148b8 Mon Sep 17 00:00:00 2001 From: Rickard Nilsson Date: Mon, 27 Jun 2016 13:02:15 +0200 Subject: nixos/libvirt: Adapt libvirtd.service to upstream sources --- nixos/modules/virtualisation/libvirtd.nix | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'nixos/modules/virtualisation') diff --git a/nixos/modules/virtualisation/libvirtd.nix b/nixos/modules/virtualisation/libvirtd.nix index 98828c280bf9..a2bfc447e9dc 100644 --- a/nixos/modules/virtualisation/libvirtd.nix +++ b/nixos/modules/virtualisation/libvirtd.nix @@ -147,19 +147,12 @@ in done ''; # */ - serviceConfig.ExecStart = ''@${pkgs.libvirt}/sbin/libvirtd libvirtd --config "${configFile}" --daemon ${concatStringsSep " " cfg.extraOptions}''; - serviceConfig.Type = "forking"; - serviceConfig.KillMode = "process"; # when stopping, leave the VMs alone - - # Wait until libvirtd is ready to accept requests. - postStart = - '' - for ((i = 0; i < 60; i++)); do - if ${pkgs.libvirt}/bin/virsh list > /dev/null; then exit 0; fi - sleep 1 - done - exit 1 # !!! seems to be ignored - ''; + serviceConfig = { + ExecStart = ''@${pkgs.libvirt}/sbin/libvirtd libvirtd --config "${configFile}" --daemon ${concatStringsSep " " cfg.extraOptions}''; + Type = "notify"; + KillMode = "process"; # when stopping, leave the VMs alone + Restart = "on-failure"; + }; }; users.extraGroups.libvirtd.gid = config.ids.gids.libvirtd; -- cgit 1.4.1