Change ovsdb file ownership to match "$OVS_USER":"$OVS_GROUP" when
we either create it for the first time, or upgrade it.

Signed-off-by: Andy Zhou <az...@ovn.org>

---
v1->v2 :  * Change ovsdb files only at the first level of ovsdb dir.
            Not doing 'chown -R'
---
 utilities/ovs-ctl.in | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
index e128889..ac424b5 100755
--- a/utilities/ovs-ctl.in
+++ b/utilities/ovs-ctl.in
@@ -148,6 +148,11 @@ start_ovsdb () {
         # Create initial database or upgrade database schema.
         upgrade_db $DB_FILE $DB_SCHEMA || return 1
 
+        # Make sure we change the ownership of the 'DB_FILE" and its related
+        # lock files, by changing the ownership of the the directory and of
+        # the files in it.
+        directory_check `dirname "$DB_FILE"`
+
         # Start ovsdb-server.
         set ovsdb-server "$DB_FILE"
         for db in $EXTRA_DBS; do
-- 
1.8.3.1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to