[ovs-dev] [PATCH ovn] ovn-nbctl: Create daemon socket in ovn run dir

Dumitru Ceara dceara at redhat.com
Tue Apr 7 09:23:17 UTC 2020


On 4/7/20 10:26 AM, numans at ovn.org wrote:
> From: Numan Siddique <numans at ovn.org>
> 
> ovn-nbctl when run as a daemon is creating the ctl socket in
> the ovs rundir. This patch fixes this issue by creating it in
> the ovn rundir.
> 
> Reported-by: Dan Williams <dcbw at redhat.com>
> Signed-off-by: Numan Siddique <numans at ovn.org>

Hi Numan,

Looks good to me.

Acked-by: Dumitru Ceara <dceara at redhat.com>

Thanks,
Dumitru

> ---
>  utilities/ovn-nbctl.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
> index 59abe0051..412796e83 100644
> --- a/utilities/ovn-nbctl.c
> +++ b/utilities/ovn-nbctl.c
> @@ -6436,7 +6436,19 @@ server_loop(struct ovsdb_idl *idl, int argc, char *argv[])
>  
>      service_start(&argc, &argv);
>      daemonize_start(false);
> -    int error = unixctl_server_create(unixctl_path, &server);
> +
> +    char *abs_unixctl_path = NULL;
> +    if (!unixctl_path) {
> +        abs_unixctl_path = get_abs_unix_ctl_path();
> +    } else {
> +        abs_unixctl_path = unixctl_path;
> +    }
> +
> +    int error = unixctl_server_create(abs_unixctl_path, &server);
> +    if (!unixctl_path) {
> +        free(abs_unixctl_path);
> +    }
> +
>      if (error) {
>          ctl_fatal("failed to create unixctl server (%s)",
>                    ovs_retval_to_string(error));
> 



More information about the dev mailing list