From patchwork Thu Nov 19 20:58:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Zhou X-Patchwork-Id: 547121 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 51055140307 for ; Sat, 21 Nov 2015 13:17:04 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 1F8CD10777; Fri, 20 Nov 2015 18:17:03 -0800 (PST) X-Original-To: dev@openvswitch.com Delivered-To: dev@openvswitch.com Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by archives.nicira.com (Postfix) with ESMTPS id 2F59110775 for ; Fri, 20 Nov 2015 18:17:02 -0800 (PST) Received: by pacdm15 with SMTP id dm15so133306272pac.3 for ; Fri, 20 Nov 2015 18:17:01 -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; bh=cw86R8kdl2obtK11cm2r7AezshhitWYj42CdGx0jqxc=; b=SereLEpt3dvqZ2MV/EH2+90y8HiqyvFsNYlfaz1AgJnLQ+vbbt11uotIlx3Hkat2XI 5V/580CS3b7y9j5R6Qs4EPkKC2J6Cvt9gtvgqx9nOU9Nt77pg5HJcf1Ecplq8gatUhuj 95atcO2HdRYjoHkwuWPPdJOlYxf//kmEeSkQD3/uyaMJqF3jHkJKSqPGSiNZCG8ZhpZ5 TcitVQL7UBPlLOY76mMpXt+uRqnYiV4rmYkSkStdxTNxH5OftIOvwVTkfNChom+HKZpt mCccFYAMXVJfhbSlioPyLGDYixNnCxe4RjvZx4Bf+7YWFt9JYX0jE26wxyU1cU61X3qI 8pLQ== X-Received: by 10.98.68.209 with SMTP id m78mr2912795pfi.46.1448072221186; Fri, 20 Nov 2015 18:17:01 -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.16.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Nov 2015 18:16:59 -0800 (PST) From: Andy Zhou To: dev@openvswitch.com Date: Thu, 19 Nov 2015 12:58:36 -0800 Message-Id: <1447966722-18204-1-git-send-email-azhou@ovn.org> X-Mailer: git-send-email 1.8.3.1 Subject: [ovs-dev] [rhel --user 1/7] ovs-ctl: Remove hard coded root user and group 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" From: Andy Zhou Replace hard coded root user and group with OVS_USER and OVS_GROUP. Signed-off-by: Andy Zhou Acked-by: Ansis Atteka Acked-by: Ben Pfaff Acked-by: Ben Pfaff --- utilities/ovs-ctl.in | 3 +++ utilities/ovs-lib.in | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in index 0082bed..c9d75df 100755 --- a/utilities/ovs-ctl.in +++ b/utilities/ovs-ctl.in @@ -13,6 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +OVS_USER=root # Default user. +OVS_GROUP=root # Default group. + case $0 in */*) dir0=`echo "$0" | sed 's,/[^/]*$,,'` ;; *) dir0=./ ;; diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in index dd8a1e9..34e2041 100644 --- a/utilities/ovs-lib.in +++ b/utilities/ovs-lib.in @@ -140,16 +140,16 @@ start_daemon () { strace="" # drop core files in a sensible place - test -d "$DAEMON_CWD" || install -d -m 755 -o root -g root "$DAEMON_CWD" + test -d "$DAEMON_CWD" || install -d -m 755 -o "$OVS_USER" -g "$OVS_GROUP" "$DAEMON_CWD" set "$@" --no-chdir cd "$DAEMON_CWD" # log file - test -d "$logdir" || install -d -m 755 -o root -g root "$logdir" + test -d "$logdir" || install -d -m 755 -o "$OVS_USER" -g "$OVS_GROUP" "$logdir" set "$@" --log-file="$logdir/$daemon.log" # pidfile and monitoring - test -d "$rundir" || install -d -m 755 -o root -g root "$rundir" + test -d "$rundir" || install -d -m 755 -o "$OVS_USER" -g "$OVS_GROUP" "$rundir" set "$@" --pidfile="$rundir/$daemon.pid" set "$@" --detach --monitor