Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1296347pxb; Fri, 21 Jan 2022 14:39:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwhhqnQXkFxDCPFe1C8DxECIpB5SlYBBXr7iHFuWIm2iewQNcJGVnB8pto5tO6gGt6cXqF7 X-Received: by 2002:a05:6a00:1883:b0:4c7:e5d6:ddad with SMTP id x3-20020a056a00188300b004c7e5d6ddadmr1058114pfh.58.1642804790406; Fri, 21 Jan 2022 14:39:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642804790; cv=none; d=google.com; s=arc-20160816; b=lkzPgZZKm+VgIWQNFuBvDAZiq237Igu0WxjZD2WFDaBhf2QqbESd4/xRtOge+YCfzD 9X5M+rsmvv+4wzEW8HwbHu2/mkS4tASKcMkK8CeX5N1hHK6IOhHiJ8Wa1pm47uS5TgEJ wjMD18549x2yLScL9R6NoPdl2nOU+KCfTPsSaJsmgifzonn/HGf0XQH7xTBOdcCskgqd wzd7BZ7MsTCg/en8w8J6qH/isKCuvSz2ikkuLN3uk1SEptEZmRsVbz+BoJ8XoZdhcENh 92Sw9giTFQHfq48S3TTjm6dbtrYTO2LAhOpOZTm/RzcKvWA74fkBmkolwI42EXPEdMOX qTVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=UaXDKza4Sh7YIM3Vzo5bFIWT6IENs7PssxfIjC5umQw=; b=NQdnbx+9YAAe8HE22y0GxqC8NtNsOmiSBdgYU1Z3z0xd/LOzek6ZUXkwyt26rXBYPe pjXpPJupJwcDL2anGRHHBnjoUG3BvpKVfRWr7NtWheaMbtW283apMyq0FCu6YNngn3j+ feiFbI2Q0leJbQYlFlzz9QfYuYgKm6l2vzV2xHPGrtrIxmPo5eoD75uDEfk9YL1yfjIZ 2Ui+PfqG96G3RpDJn69Fqigg0T0UKGrodOQH7ZZ+gdnjmmHLNyCAEDtPdnix1cxY/pUz km68tqTCDyd2AZ2IPlyEGdOCBjDx8R//dz11GIoOD+bKJFuC1tHRNlvVTmsjTWrxh34x Jygw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=yywB5zTf; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 13si7549453pgc.346.2022.01.21.14.39.33; Fri, 21 Jan 2022 14:39:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=yywB5zTf; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347377AbiATVBs (ORCPT + 99 others); Thu, 20 Jan 2022 16:01:48 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:60388 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347149AbiATVBr (ORCPT ); Thu, 20 Jan 2022 16:01:47 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 33C392195F; Thu, 20 Jan 2022 21:01:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1642712506; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UaXDKza4Sh7YIM3Vzo5bFIWT6IENs7PssxfIjC5umQw=; b=yywB5zTfYaE/pN5XftHj78h2EijpEUz2xT5plerQTtOJ2qh5xiIEiethu3x/0Df6VruRVi 2aEoqO009UgkK1FSwwBpfxcNdz6YN4iaHzsFoGDun2ZU63Ugk8QOZLMvny68Vzg5i5gwBE D+daUNXBN5ec81kEPxwttaYR2Qw/s2k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1642712506; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UaXDKza4Sh7YIM3Vzo5bFIWT6IENs7PssxfIjC5umQw=; b=CDulFiSjc14GO/F1AdHtEvXx+UAh+0L0JxXOBSVAFb7b/kaGC5Ux+BgF8tgarOPwcxI2SI Vrf9ohp2dptbkiBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C474C13EC3; Thu, 20 Jan 2022 21:01:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id swaqLLnN6WGaQwAAMHmgww (envelope-from ); Thu, 20 Jan 2022 21:01:45 +0000 Date: Thu, 20 Jan 2022 22:01:38 +0100 From: Petr Vorel To: Nikita Yushchenko Cc: ltp@lists.linux.it, kernel@openvz.org, linux-nfs@vger.kernel.org, Steve Dickson , NeilBrown Subject: Re: [PATCH] rpc_lib.sh: fix portmapper detection in case of socket activation Message-ID: Reply-To: Petr Vorel References: <20220120143727.27057-1-nikita.yushchenko@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220120143727.27057-1-nikita.yushchenko@virtuozzo.com> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi Nikita, [ Cc: Steve as user-space maintainer, also Neil and whole linux-nfs ] > On systemd-based linux hosts, rpcbind service is typically started via > socket activation, when the first client connects. If no client has > connected before LTP rpc test starts, rpcbind process will not be > running at the time of check_portmap_rpcbind() execution, causing > check_portmap_rpcbind() to report TCONF error. > Fix that by adding a quiet invocation of 'rpcinfo' before checking for > rpcbind. Looks reasonable, but I'd prefer to have confirmation from NFS experts. > For portmap, similar step is likely not needed, because portmap is used > only on old systemd and those don't use systemd. > Signed-off-by: Nikita Yushchenko > --- > testcases/network/rpc/basic_tests/rpc_lib.sh | 6 ++++++ > 1 file changed, 6 insertions(+) > diff --git a/testcases/network/rpc/basic_tests/rpc_lib.sh b/testcases/network/rpc/basic_tests/rpc_lib.sh > index c7c868709..e882e41b3 100644 > --- a/testcases/network/rpc/basic_tests/rpc_lib.sh > +++ b/testcases/network/rpc/basic_tests/rpc_lib.sh > @@ -8,6 +8,12 @@ check_portmap_rpcbind() > if pgrep portmap > /dev/null; then > PORTMAPPER="portmap" > else > + # In case of systemd socket activation, rpcbind could be > + # not started until somebody tries to connect to it's socket. > + # > + # To handle that case properly, run a client now. > + rpcinfo >/dev/null 2>&1 nit: Shouldn't we keep stderr? In LTP we put required commands into $TST_NEEDS_CMDS. It'd be better not require rpcinfo (not a hard dependency), and thus it'd be better to see "command not found" when rpcinfo missing and test fails. Kind regards, Petr > + > pgrep rpcbind > /dev/null && PORTMAPPER="rpcbind" || \ > tst_brk TCONF "portmap or rpcbind is not running" > fi