[ovs-dev] [rhel --user 3/7] utilities: fix ovsdb file ownership
Andy Zhou
azhou at ovn.org
Thu Nov 19 20:58:38 UTC 2015
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 <azhou at ovn.org>
---
utilities/ovs-lib.in | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in
index 34e2041..3fbc2f5 100644
--- a/utilities/ovs-lib.in
+++ b/utilities/ovs-lib.in
@@ -376,4 +376,8 @@ upgrade_db () {
create_db "$DB_FILE" "$DB_SCHEMA"
fi
fi
+
+ # Make sure we change the ownership of related files, such as lock files, by changing
+ # the entire directory, not just the '$DB_FILE'.
+ chown -R "$OVS_USER":"$OVS_GROUP" `dirname $DB_FILE`
}
--
1.8.3.1
More information about the dev
mailing list