On 6/7/23 08:33, Vladislav Odintsov wrote:
> Default is yes (current behavior).  This means that after start process
> will be run in background.  When "no" is given, process is run in
> foreground with `exec` call, which replaces current process (ovs-ctl) with
> wanted ovs process (ovsdb-server or ovs-vswitchd).
> 
> This option is useful when running ovs-ctl inside docker container to make
> ovs* process to be a pid 1.
> 
> Note, that with `--detach=no` database settings initialization is not done.
> db-version, system-ids are not set and transient ports are not deleted.

Hi, Vladislav.

It seems like this option makes too many compromises and not really possible
to use with many of the other options.  The main use case for ovs-ctl from
the beginning was to automate managing of two processes (ovsdb-server and
ovs-vswitchd) at the same time.  Later the ability to manage only one of them
was added.  With this new option it will also be not possible to run both.

Why not just starting ovsdb/vswitchd processes explicitly in the container?

Best regards, Ilya Maximets.

> 
> Signed-off-by: Vladislav Odintsov <[email protected]>
> ---
>  utilities/ovs-ctl.in | 5 +++++
>  utilities/ovs-lib.in | 8 +++++++-
>  2 files changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
> index 0b2820c36..72c8881e3 100644
> --- a/utilities/ovs-ctl.in
> +++ b/utilities/ovs-ctl.in
> @@ -338,6 +338,7 @@ set_defaults () {
>      DUMP_HUGEPAGES=no
>      MLOCKALL=yes
>      SELF_CONFINEMENT=yes
> +    DETACH=yes
>      MONITOR=yes
>      OVS_USER=
>      OVSDB_SERVER=yes
> @@ -442,6 +443,10 @@ Less important options for "start", "restart" and 
> "force-reload-kmod":
>    --no-full-hostname             set short hostname instead of full hostname
>    --no-record-hostname           do not attempt to determine/record system
>                                   hostname as part of start command
> +  --detach=yes|no                Run process in background (default: 
> $DETACH).
> +                                 If "no", replace current process with 
> "exec".
> +                                 Note, that with "no" database settings 
> initialization is not done.
> +                                 db-version, system-ids are not set and 
> transient ports are not deleted.
>  
>  Debugging options for "start", "restart" and "force-reload-kmod":
>    --ovsdb-server-wrapper=WRAPPER
> diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in
> index 7812a94ee..9db700e6a 100644
> --- a/utilities/ovs-lib.in
> +++ b/utilities/ovs-lib.in
> @@ -183,7 +183,13 @@ start_daemon () {
>      # pidfile and monitoring
>      install_dir "$rundir"
>      set "$@" --pidfile="$rundir/$daemon.pid"
> -    set "$@" --detach
> +
> +    if test X"$DETACH" != Xno; then
> +        set "$@" --detach
> +    else
> +        set exec "$@"
> +    fi
> +
>      test X"$MONITOR" = Xno || set "$@" --monitor
>  
>      # wrapper

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to