Create /etc/openvswitch dir when package is installed.
authorSajjad Lateef <slateef@nicira.com>
Fri, 15 Oct 2010 20:41:46 +0000 (13:41 -0700)
committerSajjad Lateef <slateef@nicira.com>
Fri, 15 Oct 2010 20:41:46 +0000 (13:41 -0700)
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
debian/openvswitch-switch.init

index b4a5287..efa38e1 100644 (file)
@@ -1,2 +1,3 @@
+/etc/openvswitch
 /etc/openvswitch-switch
 /usr/share/openvswitch/switch
index 871ac2d..935ea48 100755 (executable)
@@ -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 \