]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - etc/rc.d/pflog
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / etc / rc.d / pflog
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: pflog
7 # REQUIRE: FILESYSTEMS netif FILESYSTEMS
8 # KEYWORD: nojail
9
10 . /etc/rc.subr
11
12 name="pflog"
13 rcvar="pflog_enable"
14 command="/sbin/pflogd"
15 pidfile="/var/run/pflogd.pid"
16 start_precmd="pflog_prestart"
17 stop_postcmd="pflog_poststop"
18 extra_commands="reload resync"
19
20 # for backward compatibility
21 resync_cmd="pflog_resync"
22
23 pflog_prestart()
24 {
25         load_kld pflog || return 1
26
27         # set pflog0 interface to up state
28         if ! ifconfig pflog0 up; then
29                 warn 'could not bring up pflog0.'
30                 return 1
31         fi
32
33         # prepare the command line for pflogd
34         rc_flags="-f $pflog_logfile $rc_flags"
35
36         # report we're ready to run pflogd
37         return 0
38 }
39
40 pflog_poststop()
41 {
42         if ! ifconfig pflog0 down; then
43                 warn 'could not bring down pflog0.'
44                 return 1
45         fi
46         return 0
47 }
48
49 # for backward compatibility
50 pflog_resync()
51 {
52         run_rc_command reload
53 }
54
55 load_rc_config $name
56 run_rc_command "$1"