From patchwork Thu Nov 19 20:58:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Zhou X-Patchwork-Id: 547122 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (li376-54.members.linode.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 20612140307 for ; Sat, 21 Nov 2015 13:17:10 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 76F8110876; Fri, 20 Nov 2015 18:17:05 -0800 (PST) X-Original-To: dev@openvswitch.com Delivered-To: dev@openvswitch.com Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by archives.nicira.com (Postfix) with ESMTPS id 5307A10873 for ; Fri, 20 Nov 2015 18:17:04 -0800 (PST) Received: by pacdm15 with SMTP id dm15so133306925pac.3 for ; Fri, 20 Nov 2015 18:17:03 -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=kJ+olWkZJ478ubEMe/gjDUkJOuYM2em3s5zYvldXBy0=; b=MjZNXDKrkr7bBntD7Nwa6T7jbhToO9cVGOREf1SsSAeDV31IldBfOnUVTx7DcCYXV2 IvfBk1ptgbFybycInAufaKXc5MYsVP8SsAbLprCxd5NMtYu2SAJ4jsdlbb+hC5Xl1X/a 9fnKoVr/d/qeIkczR6yYeRYgaFf/Ig15l6QRn+f+ccN9VzdexMjLSNyNLzJjQSROyYJ0 n10DJQjn3flobwlzhJK2BJ0f0TkznXhvwyNk3eZG5nT/m7YEDEIMCcKADKB5gtVEl/5U 9ulUi2FV0YEJxX2999A4D8U97yYGC+RS/w94PQSjVKQJD52Lv0a3r5f4TV6ra5SxCCR9 L4uw== X-Received: by 10.98.70.81 with SMTP id t78mr2922001pfa.27.1448072223846; Fri, 20 Nov 2015 18:17:03 -0800 (PST) Received: from htb-1n-eng-dhcp295.eng.vmware.com ([208.91.1.34]) by smtp.gmail.com with ESMTPSA id tp6sm1309858pbc.81.2015.11.20.18.17.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Nov 2015 18:17:02 -0800 (PST) From: Andy Zhou To: dev@openvswitch.com Date: Thu, 19 Nov 2015 12:58:38 -0800 Message-Id: <1447966722-18204-3-git-send-email-azhou@ovn.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1447966722-18204-1-git-send-email-azhou@ovn.org> References: <1447966722-18204-1-git-send-email-azhou@ovn.org> Subject: [ovs-dev] [rhel --user 3/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 --- 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` }