From: Johannes Thumshirn Date: Fri, 12 Oct 2018 11:50:55 +0000 (+0200) Subject: common/rc: fix check for yp X-Git-Tag: v2022.05.01~1386 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=45d1dd73754b6b331a37fa5e5230861d6e87889c;p=users%2Fhch%2Fxfstests-dev.git common/rc: fix check for yp Only testing if a domainname is set and ypcat is installed is not a sufficient criteria to check if NIS is actually active. Check for a running ypbind in rpcinfo as well. Signed-off-by: Johannes Thumshirn Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/common/rc b/common/rc index f7d0c35a6..38d9de720 100644 --- a/common/rc +++ b/common/rc @@ -1991,7 +1991,9 @@ _yp_active() local dn dn=$(domainname 2>/dev/null) local ypcat=$(type -P ypcat) - test -n "${dn}" -a "${dn}" != "(none)" -a "${dn}" != "localdomain" -a -n "${ypcat}" + local rpcinfo=$(type -P rpcinfo) + test -n "${dn}" -a "${dn}" != "(none)" -a "${dn}" != "localdomain" -a -n "${ypcat}" -a -n "${rpcinfo}" && \ + "${rpcinfo}" -p localhost 2>/dev/null | grep -q ypbind echo $? }