3 # $FreeBSD: src/etc/rc.d/pflog,v 1.2 2004/08/31 14:23:51 mlaier Exp $
7 # REQUIRE: root mountcritlocal netif
16 stop_precmd
="test -x ${pflog_program}"
17 start_precmd
="pflog_prestart"
18 start_cmd
="pflog_start"
20 resync_precmd
="$stop_precmd"
21 resync_cmd
="pflog_resync"
22 status_precmd
="$stop_precmd"
23 status_cmd
="pflog_status"
24 extra_commands
="resync status"
28 # load pflog kernel module if needed
29 kldstat
-qm pf || kldload
-n pf ||
exit 1
31 # set pflog0 interface to up state
32 if ! ifconfig pflog0 up
; then
33 warn
'pflog: COULD NOT SET UP pflog0'
36 # check for pflogd binary
37 if [ ! -x "${pflog_program:-/sbin/pflogd}" ]
39 warn
'pflog: NO PFLOGD BINARY FOUND'
46 echo -n "Enabling pflogd"
47 if ! ${pflog_program:-/sbin/pflogd} ${pflog_flags} \
48 -f ${pflog_logfile:-/var/log/pflog}; then
57 if [ -r /var
/run
/pflogd.pid
]; then
58 echo "Stopping pflogd."
59 kill `cat /var/run/pflogd.pid`
65 if [ -r /var
/run
/pflogd.pid
]; then
66 kill -SIGHUP `cat /var/run/pflogd.pid`
72 if [ -r /var
/run
/pflogd.pid
]; then
73 ps
-p `cat /var/run/pflogd.pid` |
tail -n 1
75 echo 'pflogd not running.'