From patchwork Mon Jun 13 18:59:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ihar Hrachyshka X-Patchwork-Id: 1642963 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=GCVEOHlC; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 4LMLTx2FRSz9s0r for ; Tue, 14 Jun 2022 04:59:49 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 0E1ED60E14; Mon, 13 Jun 2022 18:59:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dNox2z_XsDwG; Mon, 13 Jun 2022 18:59:46 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 499F360A81; Mon, 13 Jun 2022 18:59:45 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 21FBDC0032; Mon, 13 Jun 2022 18:59:45 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id A1DC3C002D for ; Mon, 13 Jun 2022 18:59:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 8F939410C9 for ; Mon, 13 Jun 2022 18:59:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com 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 Q32xIuDvxXWG for ; Mon, 13 Jun 2022 18:59:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id 2B56C40961 for ; Mon, 13 Jun 2022 18:59:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655146781; 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=doDCytFeX+zz0P0Hi38/gNHdxlruMBjBUhgjsN7RRW8=; b=GCVEOHlCDWUVMq/d/IEYAW/tJ9XF8F3tIXR70/TSsoDHNFXgh3FfuR3b0l5e7O3XgHc9gT mY/fMwmBYqb3voNYpRAC7HHGv44385vnUljfJnY6wt1g3ZH19DB5jrsmR+FnRfM8431/j/ miKHe//17tsfNuqVeDWBZLq19AJuhhw= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-642-Y4FDbus-OveTqO5xTz9S9A-1; Mon, 13 Jun 2022 14:59:40 -0400 X-MC-Unique: Y4FDbus-OveTqO5xTz9S9A-1 Received: by mail-qk1-f198.google.com with SMTP id az18-20020a05620a171200b006a708307e94so5691922qkb.14 for ; Mon, 13 Jun 2022 11:59:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=doDCytFeX+zz0P0Hi38/gNHdxlruMBjBUhgjsN7RRW8=; b=gG1sVMcS+JnsUInceQqUrv5kTdZHdk1vpN0LieKmSgx/hE6NjTAMZEE0tWhMIvVP5n BXzEOyz5fAee6A+Gv2nILILxuLUykWp2MNx+JunV3zsXbEL8iv2UZ4Titq06GO2mW7X/ khsx3MUjCFouiWn+FZAJCzXRzuFDXCJpXDq5rnzUur4TI5xv70JiZIdU/JCdxIoaVXpM hBveDby3yDdgPOd0SBGp34cdPdy31VqzY55sPMlA15mOLlOHhD5rE7uFNQGubvwig/Ya Nx8tMsG+yYS90wwJS+OcfeNNC5kR++yotVDQM1+m6wvhT2XWrS/kaFolk7JK5at6moN7 LxkA== X-Gm-Message-State: AOAM5336ZnCWELKbbHlN1Gp54msD6t3KuGtQEnnA6WEzjF7Q5asG4hoU /GavNd3kIK/i8xQcnbfBOYwwa74djGn53ROeULbkSyxw6XKbT5BiUwDGuOtp6COfKqk7qeQ6hYY G8BGZDUkIiEl0eKHUmtvjnz6cCE7a3lZ2r3eSRA9UonWIOu9O5b/D83UV6iwdhTjr X-Received: by 2002:a37:a043:0:b0:6a6:a7c9:7e with SMTP id j64-20020a37a043000000b006a6a7c9007emr1151342qke.339.1655146780013; Mon, 13 Jun 2022 11:59:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxi6PNMiLYCzHsI4+F+pu1jhCk89D1DBPsE6xMHBQgrEjSFnC5+iFW9RcAPxG8aJfZbGmEfg== X-Received: by 2002:a37:a043:0:b0:6a6:a7c9:7e with SMTP id j64-20020a37a043000000b006a6a7c9007emr1151329qke.339.1655146779706; Mon, 13 Jun 2022 11:59:39 -0700 (PDT) Received: from fedora34.localdomain (cpe-172-73-180-250.carolina.res.rr.com. [172.73.180.250]) by smtp.gmail.com with ESMTPSA id v11-20020a05620a440b00b006a6d3a6d597sm7883752qkp.71.2022.06.13.11.59.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 11:59:38 -0700 (PDT) From: Ihar Hrachyshka To: dev@openvswitch.org Date: Mon, 13 Jun 2022 18:59:21 +0000 Message-Id: <20220613185922.2700748-1-ihrachys@redhat.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ihrachys@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 1/2] Fix pidfile_is_running when $cmd is not passed 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" [ -z $string ] needs double quotes to handle zero-length strings properly. Fixes: 09dc4866fd32 ("Handle re-used pids in pidfile_is_running") Signed-off-by: Ihar Hrachyshka --- utilities/ovn-ctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/ovn-ctl b/utilities/ovn-ctl index e2f05915b..46cbac4c2 100755 --- a/utilities/ovn-ctl +++ b/utilities/ovn-ctl @@ -43,7 +43,7 @@ ovn_ic_db_conf_file="$ovn_etcdir/ovn-ic-db-params.conf" pidfile_is_running () { pidfile=$1 cmd=$2 - test -e "$pidfile" && [ -s "$pidfile" ] && pid=`cat "$pidfile"` && pid_exists "$pid" && [ -z $cmd -o pid_comm_check "$cmd" "$pid" ] + test -e "$pidfile" && [ -s "$pidfile" ] && pid=`cat "$pidfile"` && pid_exists "$pid" && [ -z "$cmd" -o pid_comm_check "$cmd" "$pid" ] } >/dev/null 2>&1 stop_nb_ovsdb() {