2004-04-02 21:25:27 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: pflog
|
2012-09-11 07:04:59 +02:00
|
|
|
# REQUIRE: FILESYSTEMS netif FILESYSTEMS
|
2004-10-07 15:55:26 +02:00
|
|
|
# KEYWORD: nojail
|
2004-04-02 21:25:27 +02:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="pflog"
|
2012-01-14 03:18:41 +01:00
|
|
|
rcvar="pflog_enable"
|
2005-10-02 17:54:26 +02:00
|
|
|
command="/sbin/pflogd"
|
|
|
|
pidfile="/var/run/pflogd.pid"
|
2004-04-02 21:25:27 +02:00
|
|
|
start_precmd="pflog_prestart"
|
2005-10-02 17:54:26 +02:00
|
|
|
stop_postcmd="pflog_poststop"
|
|
|
|
extra_commands="reload resync"
|
|
|
|
|
|
|
|
# for backward compatibility
|
2004-04-02 21:25:27 +02:00
|
|
|
resync_cmd="pflog_resync"
|
|
|
|
|
|
|
|
pflog_prestart()
|
|
|
|
{
|
2006-12-31 11:37:18 +01:00
|
|
|
load_kld pflog || return 1
|
2004-04-02 21:25:27 +02:00
|
|
|
|
|
|
|
# set pflog0 interface to up state
|
|
|
|
if ! ifconfig pflog0 up; then
|
2006-12-31 11:12:53 +01:00
|
|
|
warn 'could not bring up pflog0.'
|
2004-04-02 21:25:27 +02:00
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
2005-10-02 17:54:26 +02:00
|
|
|
# prepare the command line for pflogd
|
|
|
|
rc_flags="-f $pflog_logfile $rc_flags"
|
2004-04-02 21:25:27 +02:00
|
|
|
|
2005-10-02 17:54:26 +02:00
|
|
|
# report we're ready to run pflogd
|
|
|
|
return 0
|
2004-04-02 21:25:27 +02:00
|
|
|
}
|
|
|
|
|
2005-10-02 17:54:26 +02:00
|
|
|
pflog_poststop()
|
2004-04-02 21:25:27 +02:00
|
|
|
{
|
2005-10-02 17:54:26 +02:00
|
|
|
if ! ifconfig pflog0 down; then
|
|
|
|
warn 'could not bring down pflog0.'
|
|
|
|
return 1
|
2004-04-02 21:25:27 +02:00
|
|
|
fi
|
2005-10-02 17:54:26 +02:00
|
|
|
return 0
|
2004-04-02 21:25:27 +02:00
|
|
|
}
|
|
|
|
|
2005-10-02 17:54:26 +02:00
|
|
|
# for backward compatibility
|
|
|
|
pflog_resync()
|
2004-04-02 21:25:27 +02:00
|
|
|
{
|
2005-10-02 17:54:26 +02:00
|
|
|
run_rc_command reload
|
2004-04-02 21:25:27 +02:00
|
|
|
}
|
|
|
|
|
2005-10-02 17:54:26 +02:00
|
|
|
load_rc_config $name
|
2004-04-02 21:25:27 +02:00
|
|
|
run_rc_command "$1"
|