From patchwork Fri Oct 12 11:50:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 10638567 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6440213AD for ; Fri, 12 Oct 2018 11:51:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 538842BAD0 for ; Fri, 12 Oct 2018 11:51:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47C762BAE1; Fri, 12 Oct 2018 11:51:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F01272BAD0 for ; Fri, 12 Oct 2018 11:51:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728121AbeJLTXP (ORCPT ); Fri, 12 Oct 2018 15:23:15 -0400 Received: from mx2.suse.de ([195.135.220.15]:33502 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728086AbeJLTXP (ORCPT ); Fri, 12 Oct 2018 15:23:15 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id EA180AEB9 for ; Fri, 12 Oct 2018 11:51:08 +0000 (UTC) From: Johannes Thumshirn To: fstests@vger.kernel.org Cc: Johannes Thumshirn Subject: [PATCH] common/rc: fix check for yp Date: Fri, 12 Oct 2018 13:50:55 +0200 Message-Id: <20181012115055.15416-1-jthumshirn@suse.de> X-Mailer: git-send-email 2.16.4 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- common/rc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/rc b/common/rc index d5bb1feee2c3..1882f970a508 100644 --- a/common/rc +++ b/common/rc @@ -1988,7 +1988,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 $? }