Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3427507pxb; Mon, 24 Jan 2022 09:19:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2VjAK/ekgba45A7bCdNNzn5Aj2WM607kB1c9ymWc8YGs3CHEDa6+zdt1Eh6Wrg4/reNye X-Received: by 2002:a17:902:6bc9:b0:149:b7bf:9b33 with SMTP id m9-20020a1709026bc900b00149b7bf9b33mr15504058plt.18.1643044753353; Mon, 24 Jan 2022 09:19:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643044753; cv=none; d=google.com; s=arc-20160816; b=ZtjdMZDIF81ZdqCXskV0Ti5dsIVZ+Xlnf7cFtA+pwY2uoXOyMMejSU7M/oAL7IPLCF EBye1T4Fx4UzmAHgdrKCa7xq8v+TgKTZNz3X37X7Vu+hMUkQfB+2V2nscN0XiviE4m7w aTS1I5bKCxNTruGux7P6NJKyhy05jKeoBSLiswsXz6Rx8qTaenfSoLPlbGM0wkIGLQpF XgNkE99zwLzv8iXCkTgOKUBi7BrfI/tGuEVIItDMFUlSn/X/NAiEE709RRztdyyd8pVz dt8++NHEB4RyOtAr3sBFoTtRZcZW9siswyUYhoqLrD8SjGNmM9h2mIlOmegezUQ+YUkB yTXA== 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=yJTO1ntaNYhfyc0kwrRnaOw0Kj/PjR12jA28uu4oRjU=; b=SyzTttzzxAkm9d8i+uNDs3ebxHl89jg1oVyEcxeUtbMPk/bqNDf+0YXVnqllaNzU63 ue9S0HpiLX+JV3gr/q98LYFAU2x5rQBHlkUP/FFUm7DgEOQk2FCplrg6YLsPAe9D6V61 3puyjRAJO2RmYjEj/OqIcjoRUZ3OYLau9N2VsPuhWexG7zrzqqtwv+2OyX3jcWjzNxmg hBIT3M58sG1K5fpB5PxaM+RMM9ah11Q/GOkUzPMZcr68WPFpqb2GF+p8nZGGYXAODJMn r5nQyl8KtYAT4tyivKBVX7JWyRR2h+4/kHn2RLWnooNxSX2ZcKRXfMX1eFfEYMl22XnR sJNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=gkPkSkrJ; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=6IFR7wiL; 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 z134si7394108pgz.325.2022.01.24.09.18.59; Mon, 24 Jan 2022 09:19:13 -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=gkPkSkrJ; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=6IFR7wiL; 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 S241549AbiAXGJK (ORCPT + 99 others); Mon, 24 Jan 2022 01:09:10 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:38552 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232076AbiAXGJK (ORCPT ); Mon, 24 Jan 2022 01:09:10 -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 52E4E21972; Mon, 24 Jan 2022 06:09:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1643004549; 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=yJTO1ntaNYhfyc0kwrRnaOw0Kj/PjR12jA28uu4oRjU=; b=gkPkSkrJxktYRo5q8bkBxLgOYgT5VoQHIhqHZSdHacQKj6NGb+C8+kic2E+psiUok5bstx ZvPX95MKQPn+oyqaut2ncBvKOgfe8gnNwyGTM2SljWTAKQYtk/YpH8BEPSS7NIzceEiw3C z3JYPzp3m3VQzgAyxKUBJx8IXwwGDPc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1643004549; 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=yJTO1ntaNYhfyc0kwrRnaOw0Kj/PjR12jA28uu4oRjU=; b=6IFR7wiLjWPDNg5P8yroLS6y3C9ic/AUuldwLcgG0UHmREBHw6x5Mx1a0vQAOYeKXLniJM 8cxXY4DKiFaZAbDA== 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 13FFD1331A; Mon, 24 Jan 2022 06:09:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id vZreAoVC7mHabgAAMHmgww (envelope-from ); Mon, 24 Jan 2022 06:09:09 +0000 Date: Mon, 24 Jan 2022 07:09:07 +0100 From: Petr Vorel To: NeilBrown Cc: Nikita Yushchenko , ltp@lists.linux.it, kernel@openvz.org, linux-nfs@vger.kernel.org, Steve Dickson 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> <164279789186.8775.7075880084961337149@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <164279789186.8775.7075880084961337149@noble.neil.brown.name> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org > On Fri, 21 Jan 2022, Petr Vorel wrote: > > 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 > If it were me, I would remove the 'pgrep's and just call "rpcbind -p" > and make sure something responds. Hi Neil, I guess you mean: rpcinfo -p Good idea, thanks! Kind regards, Petr > NeilBrown > > 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