FreeBSD Bugzilla – Attachment 155195 Details for
Bug 199150
/etc/rc.d/pflog always emits "starting pflogd:"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Nonrecursive Pflog -- Broken in restart case
pflog.nonrecurse.patch (text/plain), 1.96 KB, created by
Jason Unovitch
on 2015-04-05 11:48:15 UTC
(
hide
)
Description:
Nonrecursive Pflog -- Broken in restart case
Filename:
MIME Type:
Creator:
Jason Unovitch
Created:
2015-04-05 11:48:15 UTC
Size:
1.96 KB
patch
obsolete
>Index: etc/rc.d/pflog >=================================================================== >--- etc/rc.d/pflog (revision 281061) >+++ etc/rc.d/pflog (working copy) >@@ -24,6 +24,14 @@ > { > load_kld pflog || return 1 > >+ # create pflog_dev interface if needed >+ if ! ifconfig $pflog_dev > /dev/null; then >+ if ! ifconfig $pflog_dev create; then >+ warn "could not create $pflog_dev." >+ return 1 >+ fi >+ fi >+ > # set pflog_dev interface to up state > if ! ifconfig $pflog_dev up; then > warn "could not bring up $pflog_dev." >@@ -30,24 +38,16 @@ > return 1 > fi > >+ # -p flag requires striping pidfile's leading /var/run and trailing .pid >+ pidfile=$(echo $pidfile | sed -e 's|/var/run/||' -e 's|.pid$||') >+ > # prepare the command line for pflogd >- rc_flags="-f $pflog_logfile -i $pflog_dev $rc_flags" >+ rc_flags="-p $pidfile -f $pflog_logfile -i $pflog_dev $rc_flags" > > # report we're ready to run pflogd > return 0 > } > >-pflog_poststart() { >- # Allow child pflogd to settle >- sleep 0.10 >- # More elegant(?) method for getting a unique pid >- if [ -f /var/run/pflogd.pid ]; then >- mv /var/run/pflogd.pid $pidfile >- else >- warn "/var/run/pflogd.pid does not exist. Too fast." >- fi >-} >- > pflog_poststop() > { > if ! ifconfig $pflog_dev down; then >@@ -71,9 +71,7 @@ > load_rc_config $name > > # Check if spawning multiple pflogd >-echo "Starting pflogd: $pflog_instances" > if [ "$pflog_instances" ] && [ -n "$pflog_instances" ]; then >- start_postcmd="pflog_poststart" > # Interate through requested instances. > for i in $pflog_instances; do > # Set required variables >@@ -89,10 +87,14 @@ > warn "pflog_logfile not set" > continue > fi >- # pflogd sets a pidfile, but the name is hardcoded. Concoct a >- # unique pidfile name. >+ >+ # Provide a unique pidfile name for pflogd -p <pidfile> flag > pidfile="/var/run/pflogd.$i.pid" >+ >+ # Override service name and execute command >+ name=$pflog_dev > run_rc_command "$1" >+ #_rc_restart_done=false > done > else > # Typical case, spawn single instance only.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 199150
:
155192
| 155195 |
155198