From patchwork Mon Jun 27 16:00:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Terry Wilson X-Patchwork-Id: 1649039 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=bP1oOLof; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LWss30mjsz9sGk for ; Tue, 28 Jun 2022 02:00:54 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id C93B941977; Mon, 27 Jun 2022 16:00:52 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org C93B941977 Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=bP1oOLof X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2FoOFRGM0cph; Mon, 27 Jun 2022 16:00:51 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 5C835418F0; Mon, 27 Jun 2022 16:00:50 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 5C835418F0 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1499CC0039; Mon, 27 Jun 2022 16:00:50 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 541AEC002D for ; Mon, 27 Jun 2022 16:00:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 20AD582BBA for ; Mon, 27 Jun 2022 16:00:48 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 20AD582BBA Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=bP1oOLof X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bWx0GxsJWzwB for ; Mon, 27 Jun 2022 16:00:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 48E3382AA9 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 48E3382AA9 for ; Mon, 27 Jun 2022 16:00:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656345645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v6pHNKS6kJeLof1nxSpkGvHf+a40BZaxw5lfhXE2XjE=; b=bP1oOLofBtsJ2CTiXFi0chdhkJGk+LjQ3LV8H9opIav8GB72Y6Yqu8TB9x/Y/IFiHnUSxp fsOgBNdBU3StvOOz2dLBaKw2r8COGQ9Oal75zFyMv42ctQWbej8i+EJ++3vB5+KN8GzfHh lq7sorx89eLWbuP9jPgE9YyLuETiek0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-610-oBeJzekuPCyyRQ1qVcJFSA-1; Mon, 27 Jun 2022 12:00:44 -0400 X-MC-Unique: oBeJzekuPCyyRQ1qVcJFSA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5C3D585A580 for ; Mon, 27 Jun 2022 16:00:44 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.33.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2FDF52026D64; Mon, 27 Jun 2022 16:00:44 +0000 (UTC) From: Terry Wilson To: dev@openvswitch.org Date: Mon, 27 Jun 2022 11:00:42 -0500 Message-Id: <20220627160042.115781-1-twilson@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=twilson@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn v3 1/1] Allow arbitrary args to be passed to called binary X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" It is common to pass ovn-ctl options via an /etc/sysconfig file. It would be useful to be able to pass custom --remote options or additional DBs to listen to via this file. This would give end users the ability to have more fine-grained control without having to modify ovn-ctl. Signed-off-by: Terry Wilson Acked-by: Dumitru Ceara --- utilities/ovn-ctl | 22 ++++++++++++++++++++++ utilities/ovn-ctl.8.xml | 14 +++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/utilities/ovn-ctl b/utilities/ovn-ctl index 23d4d7f8c..93be9b84b 100755 --- a/utilities/ovn-ctl +++ b/utilities/ovn-ctl @@ -311,6 +311,10 @@ $cluster_remote_port set "$@" --sync-from=`cat $active_conf_file` fi + if test X"$extra_args" != X; then + set "$@" $extra_args + fi + local run_ovsdb_in_bg="no" local process_id= if test X$detach = Xno && test $mode = cluster && test -z "$cluster_remote_addr" ; then @@ -541,6 +545,10 @@ start_ic () { set "$@" $OVN_IC_LOG $ovn_ic_params + if test X"$extra_args" != X; then + set "$@" $extra_args + fi + OVS_RUNDIR=${OVS_RUNDIR} start_ovn_daemon "$OVN_IC_PRIORITY" "$OVN_IC_WRAPPER" "$@" fi } @@ -563,6 +571,10 @@ start_controller () { [ "$OVN_USER" != "" ] && set "$@" --user "$OVN_USER" + if test X"$extra_args" != X; then + set "$@" $extra_args + fi + OVS_RUNDIR=${OVS_RUNDIR} start_ovn_daemon "$OVN_CONTROLLER_PRIORITY" "$OVN_CONTROLLER_WRAPPER" "$@" } @@ -590,6 +602,10 @@ start_controller_vtep () { [ "$OVN_USER" != "" ] && set "$@" --user "$OVN_USER" + if test X"$extra_args" != X; then + set "$@" $extra_args + fi + OVS_RUNDIR=${OVS_RUNDIR} start_ovn_daemon "$OVN_CONTROLLER_PRIORITY" "$OVN_CONTROLLER_WRAPPER" "$@" } @@ -1106,8 +1122,10 @@ EOF set_defaults command= +extra_args= for arg do + shift case $arg in -h | --help) usage @@ -1130,6 +1148,10 @@ do type=bool set_option ;; + --) + extra_args=$@ + break + ;; -*) echo >&2 "$0: unknown option \"$arg\" (use --help for help)" exit 1 diff --git a/utilities/ovn-ctl.8.xml b/utilities/ovn-ctl.8.xml index a1d39b22b..42d16fabc 100644 --- a/utilities/ovn-ctl.8.xml +++ b/utilities/ovn-ctl.8.xml @@ -4,7 +4,10 @@

ovn-ctl -- Open Virtual Network northbound daemon lifecycle utility

Synopsis

-

ovn-ctl [options] command

+

+ ovn-ctl [options] command + [--- extra_args] +

Description

This program is intended to be invoked internally by Open Virtual Network @@ -156,6 +159,15 @@

--db-nb-probe-interval-to-active=Time in milliseconds

--db-sb-probe-interval-to-active=Time in milliseconds

+

Extra Options

+

+ Any options after '--' will be passed on to the binary run by + command with the exception of start_northd, which can have + options specified in ovn-northd-db-params.conf. Any extra_args + passed to start_northd will be passed to the ovsdb-servers if + --ovn-manage-ovsdb=yes +

+

Configuration files

Following are the optional configuration files. If present, it should be located in the etc dir