From: Ben Pfaff <blp@nicira.com>
Date: Mon, 8 Aug 2011 17:58:38 +0000 (-0700)
Subject: debian: Ensure that /var/run/openvswitch exists in controller init script.
X-Git-Tag: v1.2.1~8
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=5c053952bc2201d3429b49fcb2fe7dc313079b31;p=sliver-openvswitch.git

debian: Ensure that /var/run/openvswitch exists in controller init script.

It would be better to use ovs-ctl from this script, but until now this is
an adequate solution.

Reported-by: Jibesh Patra
Bug-report: https://bugs.launchpad.net/bugs/822142
---

diff --git a/debian/openvswitch-controller.init b/debian/openvswitch-controller.init
index 4781f83f2..1638f1495 100755
--- a/debian/openvswitch-controller.init
+++ b/debian/openvswitch-controller.init
@@ -1,5 +1,6 @@
 #!/bin/sh
 #
+# Copyright (c) 2011 Nicira Networks Inc.
 # Copyright (c) 2007, 2009 Javier Fernandez-Sanguino <jfs@debian.org>
 #
 # This is free software; you may redistribute it and/or modify
@@ -105,6 +106,10 @@ start_server() {
         exit 0
     fi
 
+    if [ ! -d /var/run/openvswitch ]; then
+        install -d -m 755 -o root -g root /var/run/openvswitch
+    fi
+
     SSL_OPTS=
     case $LISTEN in
         *ssl*)