From patchwork Fri Nov 20 11:33:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Zhou X-Patchwork-Id: 548424 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 7F60F1402E2 for ; Wed, 25 Nov 2015 19:08:31 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id CF00210B17; Wed, 25 Nov 2015 00:08:28 -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 A582F10B16 for ; Wed, 25 Nov 2015 00:08:27 -0800 (PST) Received: by pabfh17 with SMTP id fh17so51571556pab.0 for ; Wed, 25 Nov 2015 00:08:27 -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=YLqyPYqG8hmUgukIIKS71fbHNKyCtrXScI7LWgIr5Bg=; b=UWsCdhEmyb+fx/D/Sd6+FpGfYjXR2Cjyk1eGdx5X6PPbbR6H32k7nRX7w1pnCULpZl Wd+JCC/mT+BqKeMUKJ1RdurVIMpUqbFGh1g/2D0Z07Sw+NDxC634REa+OdY/Cl/9quUZ DDPcKBD20ZIZioLdSZgKo2+jgl946fRhP0XB1bxPwEropn3xGBzAdV1dPaoP6wEdpKtK TD2E7eIw45gdXjDR5tJckCS9MHJcNZPrgSsZ3re5Bo6PImZntf/hoB+G2Z2mSDwQhc6A CtRyOVP94KCd1EAAbg9Svgxb8sa9Kj101S7r3ExoY0wW2NhV3s/JsM6bcwT+hE8NrVG0 KldQ== X-Received: by 10.98.12.20 with SMTP id u20mr29199524pfi.71.1448438906903; Wed, 25 Nov 2015 00:08:26 -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.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Nov 2015 00:08:25 -0800 (PST) From: Andy Zhou To: dev@openvswitch.com Date: Fri, 20 Nov 2015 03:33:14 -0800 Message-Id: <1448019200-87207-1-git-send-email-azhou@ovn.org> X-Mailer: git-send-email 1.8.3.1 Subject: [ovs-dev] [rhel --user v2 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" 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: Flavio Leitner --- 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