because rc.subr has special-casing for spamd/spamlogd.
Teach the script to detect the pflog interface from spamlogd flags and
create the correct interface if needed.
ok jturner@
#!/bin/ksh
#
-# $OpenBSD: spamlogd,v 1.5 2022/04/11 09:32:20 sthen Exp $
+# $OpenBSD: spamlogd,v 1.6 2022/04/21 09:31:28 sthen Exp $
daemon="/usr/libexec/spamlogd"
rc_reload=NO
rc_pre() {
- [[ ${spamd_flags} != NO && ${spamd_black} == NO ]] && return 1
+ pflog=$(echo $daemon_flags | sed -En 's/.*-l *(pflog[0-9]+).*/\1/p')
+ pflog=${pflog:-pflog0}
+
if pfctl -si | grep -q Enabled; then
- ifconfig pflog0 create
- if ifconfig pflog0; then
- ifconfig pflog0 up
+ ifconfig $pflog create
+ if ifconfig $pflog; then
+ ifconfig $pflog up
else
return 1
fi