From: Petr Vorel <pvorel@suse.cz>
To: Nikita Yushchenko <nikita.yushchenko@virtuozzo.com>
Cc: ltp@lists.linux.it, kernel@openvz.org, linux-nfs@vger.kernel.org,
Steve Dickson <SteveD@redhat.com>, NeilBrown <neilb@suse.de>
Subject: Re: [PATCH] rpc_lib.sh: fix portmapper detection in case of socket activation
Date: Thu, 20 Jan 2022 22:01:38 +0100 [thread overview]
Message-ID: <YenNsuS1gcA9tDe3@pevik> (raw)
In-Reply-To: <20220120143727.27057-1-nikita.yushchenko@virtuozzo.com>
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 <nikita.yushchenko@virtuozzo.com>
> ---
> 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
next parent reply other threads:[~2022-01-20 21:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220120143727.27057-1-nikita.yushchenko@virtuozzo.com>
2022-01-20 21:01 ` Petr Vorel [this message]
2022-01-21 4:57 ` [PATCH] rpc_lib.sh: fix portmapper detection in case of socket activation Nikita Yushchenko
2022-01-21 5:29 ` Petr Vorel
2022-01-21 5:41 ` Nikita Yushchenko
2022-01-21 6:30 ` Petr Vorel
2022-01-21 6:50 ` Nikita Yushchenko
2022-01-21 20:44 ` NeilBrown
2022-01-24 6:09 ` Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YenNsuS1gcA9tDe3@pevik \
--to=pvorel@suse.cz \
--cc=SteveD@redhat.com \
--cc=kernel@openvz.org \
--cc=linux-nfs@vger.kernel.org \
--cc=ltp@lists.linux.it \
--cc=neilb@suse.de \
--cc=nikita.yushchenko@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox