From owner-svn-src-head@freebsd.org Sun Mar 27 17:22:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37AC6ADFD6D; Sun, 27 Mar 2016 17:22:28 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0737E1C5E; Sun, 27 Mar 2016 17:22:27 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2RHMRXb008759; Sun, 27 Mar 2016 17:22:27 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2RHMRJw008751; Sun, 27 Mar 2016 17:22:27 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201603271722.u2RHMRJw008751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 27 Mar 2016 17:22:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297315 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 17:22:28 -0000 Author: kp Date: Sun Mar 27 17:22:27 2016 New Revision: 297315 URL: https://svnweb.freebsd.org/changeset/base/297315 Log: pf: Friendly error message for status if pf.ko is not loaded Check if pf.ko is loaded (i.e. /dev/pf exists) before trying to use it. This means that '/etc/rc.d/pf status' will no longer return 'pfctl: /dev/pf: No such file or directory' but 'pf.ko is not loaded'. PR: 205671 Submitted by: Johannes Jost Meixner Modified: head/etc/rc.d/pf Modified: head/etc/rc.d/pf ============================================================================== --- head/etc/rc.d/pf Sun Mar 27 16:27:49 2016 (r297314) +++ head/etc/rc.d/pf Sun Mar 27 17:22:27 2016 (r297315) @@ -66,7 +66,11 @@ pf_resync() pf_status() { - $pf_program -s info + if ! [ -c /dev/pf ] ; then + echo "pf.ko is not loaded" + else + $pf_program -s info + fi } run_rc_command "$1"