diff mbox

[ovs-dev,rhel,--user,v2,6/7] utilities: fix ovsdb file ownership

Message ID 1448019200-87207-6-git-send-email-azhou@ovn.org
State Changes Requested
Headers show

Commit Message

Andy Zhou Nov. 20, 2015, 11:33 a.m. UTC
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@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(+)

Comments

Flavio Leitner Nov. 26, 2015, 11:45 p.m. UTC | #1
On Fri, Nov 20, 2015 at 03:33:19AM -0800, Andy Zhou wrote:
> 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@ovn.org>
> 
> ---

Acked-by: Flavio Leitner <fbl@sysclose.org>
diff mbox

Patch

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