[ovs-dev] [PATCH] Create /etc/openvswitch dir when package is installed.

Sajjad Lateef slateef at nicira.com
Fri Oct 15 20:50:30 UTC 2010


Earlier, the /etc/openvswitch directory would get installed as part of
the init script's start sequence. However, as newer packages are added,
including some that create files in this directory during their init
script sequences, a race condition may occur.

This change ensures that the directory /etc/openvswitch is created even
before the init scripts execute. Thus, the race condition is avoided.
---
 debian/openvswitch-switch.dirs |    1 +
 debian/openvswitch-switch.init |    2 --
 2 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/debian/openvswitch-switch.dirs b/debian/openvswitch-switch.dirs
index b4a5287..efa38e1 100644
--- a/debian/openvswitch-switch.dirs
+++ b/debian/openvswitch-switch.dirs
@@ -1,2 +1,3 @@
+/etc/openvswitch
 /etc/openvswitch-switch
 /usr/share/openvswitch/switch
diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init
index 871ac2d..935ea48 100755
--- a/debian/openvswitch-switch.init
+++ b/debian/openvswitch-switch.init
@@ -203,8 +203,6 @@ case "$1" in

         # Create an empty configuration database if it doesn't exist.
         if test ! -e /etc/openvswitch/conf.db; then
-            install -d -m 755 -o root -g root /etc/openvswitch
-
             # Create configuration database.
             ovsdb-tool -vANY:console:emer \
                 create /etc/openvswitch/conf.db \
--
1.5.6.5


-- 
Sajjad Lateef
slateef at nicira.com




More information about the dev mailing list