blob: 77faa3b7bdf89562b3978544c270dd638a50886c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
#!/bin/sh
# PROVIDE: obspamlogd
# REQUIRE: NETWORKING SERVERS obspamd
# BEFORE: DAEMON
# KEYWORD: shutdown
#
# Define these obspamlogd_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
#
# obspamlogd_enable="YES" # Run the spamlogd(8) daemon (YES/NO).
# obspamlogd_flags="" # Extra flags for spamlogd(8) (if enabled).
# obspamlogd_pflog_if="" # pflog Interface for spamlogd(8) to monitor
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
obspamlogd_enable=${obspamlogd_enable:-"NO"}
. /etc/rc.subr
name="obspamlogd"
rcvar=obspamlogd_enable
command="%%PREFIX%%/libexec/spamlogd"
start_precmd="obspamlogd_precmd"
stop_postcmd="obspamlogd_cleanup"
pidfile="/var/run/spamlogd.pid"
obspamlogd_precmd()
{
if [ ! -z "${obspamlogd_pflog_if}" ]; then
# Configure i/f explicitly
load_kld pflog || {
warn "Unable to kldload pflog module"
return 1
}
if ! ifconfig ${obspamlogd_pflog_if} create up; then
warn "could not bring up ${obspamlogd_pflog_if}"
return 1
fi
rc_flags="${rc_flags} -l ${obspamlogd_pflog_if}"
fi
_rc=0
/sbin/mount -p | grep 'fdescfs.*/dev/fd.*fdescfs.*rw' 2>&1 > /dev/null
_rc=${?}
if [ ${_rc} -ne 0 ]; then
echo "Unable to start ${name}"
echo ""
echo "Please mount fdescfs with the following line in /etc/fstab"
echo ""
echo " fdescfs /dev/fd fdescfs rw 0 0"
echo ""
fi
return ${_rc}
}
obspamlogd_cleanup()
{
if [ -n "${obspamlogd_pflog_if}" ]; then
ifconfig ${obspamlogd_pflog_if} destroy
fi
/bin/rm -f ${pidfile}
}
load_rc_config $name
run_rc_command "$1"
|