3 # $FreeBSD: src/etc/rc.d/pflog,v 1.2 2004/08/31 14:23:51 mlaier Exp $
4 # $DragonFly: src/etc/rc.d/pflog,v 1.5 2008/01/08 15:30:34 matthias Exp $
8 # REQUIRE: root mountcritlocal netif
17 stop_precmd
="test -x ${pflog_program}"
18 start_precmd
="pflog_prestart"
19 start_cmd
="pflog_start"
21 resync_precmd
="$stop_precmd"
22 resync_cmd
="pflog_resync"
23 status_precmd
="$stop_precmd"
24 status_cmd
="pflog_status"
25 extra_commands
="resync status"
29 # load pflog kernel module if needed
30 if [ `kldstat -q -m "pflog"` -eq 1 ]; then
32 info
'pflog module loaded.'
34 err
1 'pflog module failed to load.'
38 # set pflog0 interface to up state
39 if ! ifconfig pflog0 up
; then
40 warn
'pflog: COULD NOT SET UP pflog0'
43 # check for pflogd binary
44 if [ ! -x "${pflog_program:-/sbin/pflogd}" ]
46 warn
'pflog: NO PFLOGD BINARY FOUND'
53 echo -n "Enabling pflogd"
54 if ! ${pflog_program:-/sbin/pflogd} ${pflog_flags} \
55 -f ${pflog_logfile:-/var/log/pflog}; then
64 if [ -r /var
/run
/pflogd.pid
]; then
65 echo "Stopping pflogd."
66 kill `cat /var/run/pflogd.pid`
72 if [ -r /var
/run
/pflogd.pid
]; then
73 kill -SIGHUP `cat /var/run/pflogd.pid`
79 if [ -r /var
/run
/pflogd.pid
]; then
80 ps
-p `cat /var/run/pflogd.pid` |
tail -n 1
82 echo 'pflogd not running.'