From patchwork Fri Nov 20 11:33:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Zhou X-Patchwork-Id: 548429 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id A80FC1402E2 for ; Wed, 25 Nov 2015 19:09:12 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 6A27010B4B; Wed, 25 Nov 2015 00:08:36 -0800 (PST) X-Original-To: dev@openvswitch.com Delivered-To: dev@openvswitch.com Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by archives.nicira.com (Postfix) with ESMTPS id CF95710B3D for ; Wed, 25 Nov 2015 00:08:34 -0800 (PST) Received: by pacej9 with SMTP id ej9so50033081pac.2 for ; Wed, 25 Nov 2015 00:08:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8NoytSnPpsrtZzM01f6mFj/72Mem3Kx5n+xpPpyVDYE=; b=cFUe1u42PHCdI2/wi8hIzTQlQEjctyyQna8vKHUSZLnlmLmnWmVRQQTZi/pr/rmJVZ wdttHEN/sewALzg0WIBHINhGxP8SLSeT/h4JGH28ZfLOmOQE6d7H29fumbStkVq9KI+k ZlrcVzpWzQY890Yb8iGDSv7TwCVhqkVBtGPFLzGH/vUxpRf+oHp2mn+in7myrClNEHVo UH2TMokQu0Hgziu8WfCuBiAZhOqHE6vgvuWbyoI2UnfKawV831UfkP/TFpyJTWUubJ1D qdKzjaCImIGs8Nlr0x47JVp3e9TzMcm5AHq/Kj7LVJv/fj7O9R0vhsyAg9oJvRUDcqep gnqQ== X-Received: by 10.66.132.37 with SMTP id or5mr49918064pab.5.1448438914381; Wed, 25 Nov 2015 00:08:34 -0800 (PST) Received: from htb-1n-eng-dhcp261.eng.vmware.com ([208.91.1.34]) by smtp.gmail.com with ESMTPSA id r79sm18939301pfa.61.2015.11.25.00.08.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Nov 2015 00:08:33 -0800 (PST) From: Andy Zhou To: dev@openvswitch.com Date: Fri, 20 Nov 2015 03:33:19 -0800 Message-Id: <1448019200-87207-6-git-send-email-azhou@ovn.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1448019200-87207-1-git-send-email-azhou@ovn.org> References: <1448019200-87207-1-git-send-email-azhou@ovn.org> Subject: [ovs-dev] [rhel --user v2 6/7] utilities: fix ovsdb file ownership X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" 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 Acked-by: Flavio Leitner --- 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