From 1f5f472a8a21f9bceed7f50c581007cb9c7ec3d6 Mon Sep 17 00:00:00 2001 From: Thomas Strobel Date: Thu, 24 Sep 2015 14:51:44 +0200 Subject: [PATCH] Revert "openvswitch module: do not fork services" This reverts commit fcab752abf94ae36e903097846c752d6b22e0dff. --- nixos/modules/virtualisation/openvswitch.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/nixos/modules/virtualisation/openvswitch.nix b/nixos/modules/virtualisation/openvswitch.nix index 4d6123e4ce51..a0231315236c 100644 --- a/nixos/modules/virtualisation/openvswitch.nix +++ b/nixos/modules/virtualisation/openvswitch.nix @@ -102,11 +102,14 @@ in { --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \ --unixctl=ovsdb.ctl.sock \ --pidfile=/var/run/openvswitch/ovsdb.pid \ + --detach \ /var/db/openvswitch/conf.db ''; Restart = "always"; RestartSec = 3; PIDFile = "/var/run/openvswitch/ovsdb.pid"; + # Use service type 'forking' to correctly determine when ovsdb-server is ready. + Type = "forking"; }; postStart = '' ${cfg.package}/bin/ovs-vsctl --timeout 3 --retry --no-wait init @@ -122,9 +125,12 @@ in { serviceConfig = { ExecStart = '' ${cfg.package}/bin/ovs-vswitchd \ - --pidfile=/var/run/openvswitch/ovs-vswitchd.pid + --pidfile=/var/run/openvswitch/ovs-vswitchd.pid \ + --detach ''; PIDFile = "/var/run/openvswitch/ovs-vswitchd.pid"; + # Use service type 'forking' to correctly determine when vswitchd is ready. + Type = "forking"; }; }; @@ -149,10 +155,12 @@ in { ${cfg.package}/bin/ovs-monitor-ipsec \ --root-prefix ${runDir}/ipsec \ --pidfile /var/run/openvswitch/ovs-monitor-ipsec.pid \ - --monitor \ + --monitor --detach \ unix:/var/run/openvswitch/db.sock ''; PIDFile = "/var/run/openvswitch/ovs-monitor-ipsec.pid"; + # Use service type 'forking' to correctly determine when ovs-monitor-ipsec is ready. + Type = "forking"; }; preStart = ''