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 b4a528732361bcf93590d5b5f8b04d3b084c08c3..efa38e1419d2eb91391de673ce17a63b0cd953d7 100644 (file)
@@ -1,2 +1,3 @@
+/etc/openvswitch
 /etc/openvswitch-switch
 /usr/share/openvswitch/switch
index 871ac2d4fa9faa45f4307f75d04a3ea9c1b0bc25..935ea48e7f4b72f6ddcf3ea9a5e0fb5ca61f2890 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 \