mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
5ca51aad69
allow them to start after netif. There were too many problems reported with this change in the short period of time that it lived in HEAD, and we are too late in the release cycle to properly shake it out. IMO the issue of having the firewalls up before the network is still a valid concern, particularly for pf whose default state is wide open. However properly solving this issue is going to take some investment on the part of the people who actually use those tools. This is not a strict reversion of all the changes for r193198 since it also included some simplification of the BEFORE/REQUIRE logic which is still valid for ipfilter and ip6fw.
57 lines
876 B
Bash
Executable File
57 lines
876 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: pflog
|
|
# REQUIRE: FILESYSTEMS netif cleanvar
|
|
# KEYWORD: nojail
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="pflog"
|
|
rcvar=`set_rcvar`
|
|
command="/sbin/pflogd"
|
|
pidfile="/var/run/pflogd.pid"
|
|
start_precmd="pflog_prestart"
|
|
stop_postcmd="pflog_poststop"
|
|
extra_commands="reload resync"
|
|
|
|
# for backward compatibility
|
|
resync_cmd="pflog_resync"
|
|
|
|
pflog_prestart()
|
|
{
|
|
load_kld pflog || return 1
|
|
|
|
# set pflog0 interface to up state
|
|
if ! ifconfig pflog0 up; then
|
|
warn 'could not bring up pflog0.'
|
|
return 1
|
|
fi
|
|
|
|
# prepare the command line for pflogd
|
|
rc_flags="-f $pflog_logfile $rc_flags"
|
|
|
|
# report we're ready to run pflogd
|
|
return 0
|
|
}
|
|
|
|
pflog_poststop()
|
|
{
|
|
if ! ifconfig pflog0 down; then
|
|
warn 'could not bring down pflog0.'
|
|
return 1
|
|
fi
|
|
return 0
|
|
}
|
|
|
|
# for backward compatibility
|
|
pflog_resync()
|
|
{
|
|
run_rc_command reload
|
|
}
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|