Bug 205671 - etc/rc.d/pf: report "pf not running" if /dev/pf doesn't exist
Summary: etc/rc.d/pf: report "pf not running" if /dev/pf doesn't exist
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-rc mailing list
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-12-28 18:47 UTC by Johannes Jost Meixner
Modified: 2016-03-27 17:28 UTC (History)
2 users (show)

See Also:


Attachments
pf rc.d script changed (330 bytes, patch)
2015-12-28 18:47 UTC, Johannes Jost Meixner
no flags Details | Diff
patch pf rc script (331 bytes, patch)
2016-03-25 07:47 UTC, Johannes Jost Meixner
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Jost Meixner freebsd_committer 2015-12-28 18:47:11 UTC
Created attachment 164775 [details]
pf rc.d script changed

Patch attached changes the behavior of /etc/rc.d/pf in case /dev/pf does not exist, and generates a "pf is not running." message.
Comment 1 Kristof Provost freebsd_committer 2015-12-28 21:49:33 UTC
This only changes the 'status' command, right? What's the use case here?
Comment 2 Johannes Jost Meixner freebsd_committer 2016-03-25 07:47:54 UTC
Created attachment 168602 [details]
patch pf rc script

The use case is not having `service pf status` throw error lines like this one:

xmj@mx12:~/repos/src-svnssh$ pfctl -s info
pfctl: /dev/pf: No such file or directory

and actually display that pf isn't loaded.
Comment 3 commit-hook freebsd_committer 2016-03-27 17:22:41 UTC
A commit references this bug:

Author: kp
Date: Sun Mar 27 17:22:27 UTC 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 <xmj@FreeBSD.org>

Changes:
  head/etc/rc.d/pf