Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 May 2018 11:27:24 +0000
From:      bugzilla-noreply@freebsd.org
To:        standards@FreeBSD.org
Subject:   [Bug 228632] /etc/rc.d/pf returns incorrect exit status.
Message-ID:  <bug-228632-99@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D228632

            Bug ID: 228632
           Summary: /etc/rc.d/pf returns incorrect exit status.
           Product: Base System
           Version: 11.1-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: standards
          Assignee: standards@FreeBSD.org
          Reporter: jimmypw@gmail.com

Overview:

In the pf rc.d script the output of `/etc/rc.d/pf status` or `/etc/rc.d/pf
onestatus` always provides an exit status of 0. This makes it fiddly to
programmatically determine if pf is running or not.=20

To Reproduce:

Run `/etc/rc.d/pf onestatus` at any point before pf has been started for the
first time or after the service has been stopped.

Actual Results:

Case 1) (When module not loaded)
# service pf onestatus
pf.ko is not loaded
# echo $?
0

Case 2) (When module is loaded but the status is disabled)
# service pf onestatus
Status: Disabled for 0 days 00:01:48          Debug: Urgent

State Table                          Total             Rate
  current entries                        0=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20
...snip...
# echo $?
0


Expected results:

`service pf onestatus; echo $?` should return a non-zero exit status when t=
he
service is not running.


Additional information:

While returning a non-zero exit status in the instance where the pf module =
has
not been loaded is a trivial modification to the init script. From what I c=
an
tell from pfctl(8) there is no functionality to provide an exit status
reflecting the running state of pf.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-228632-99>