diff --git a/src/etc/rc b/src/etc/rc index 67ef220b..086b62ac 100644 --- a/src/etc/rc +++ b/src/etc/rc @@ -1,4 +1,4 @@ -# $OpenBSD: rc,v 1.380 2011/07/08 16:20:13 ajacoutot Exp $ +# $OpenBSD: rc,v 1.381 2011/07/08 21:42:52 robert Exp $ # System startup script run by init on autoboot # or after single-user. @@ -415,16 +415,7 @@ dmesg >/var/run/dmesg.boot make_keys echo -n 'starting early daemons:' -start_daemon syslogd ldattach - -if [ X"${pf}" != X"NO" ]; then - ifconfig pflog0 create >/dev/null 2>&1 - if ifconfig pflog0 >/dev/null 2>&1; then - ifconfig pflog0 up - start_daemon pflogd - fi -fi - +start_daemon syslogd ldattach pflogd start_daemon named nsd ntpd isakmpd iked sasyncd echo '.' diff --git a/src/etc/rc.conf b/src/etc/rc.conf index 0c6a93e7..aea684a4 100644 --- a/src/etc/rc.conf +++ b/src/etc/rc.conf @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: rc.conf,v 1.153 2011/07/08 18:01:31 ajacoutot Exp $ +# $OpenBSD: rc.conf,v 1.154 2011/07/08 21:42:52 robert Exp $ # set these to "NO" to turn them off. otherwise, they're used as flags ldpd_flags=NO # for normal use: "" @@ -53,7 +53,7 @@ kdc_flags=NO # for normal use: "" see 'info heimdal' for help kadmind_flags=NO # for normal use: "" kpasswdd_flags=NO # for normal use: "" btd_flags=NO # for normal use: "" -amd_flags=NO +amd_flags=NO # for normal use: "" # use -u to disable chroot, see httpd(8) httpd_flags=NO # for normal use: "" (or "-DSSL" after reading ssl(8)) @@ -127,6 +127,12 @@ if [ X"${spamd_flags}" = X"NO" -o X"${spamd_black}" != X"NO" ]; then spamlogd_flags=NO fi +# special care needed for pflogd to avoid starting it up and failing +# if pf is not enabled +if [ X"${PF}" = X"NO" ]; then + pflogd_flags=NO +fi + # backward compatibility : ${inetd_flags=$([ X"${inetd-YES}" = XYES ] || echo NO)} : ${rwhod_flags=$([ X"${rwhod-NO}" = XYES ] || echo NO)} diff --git a/src/etc/rc.d/pflogd b/src/etc/rc.d/pflogd index 0c4be02a..37212954 100644 --- a/src/etc/rc.d/pflogd +++ b/src/etc/rc.d/pflogd @@ -1,6 +1,6 @@ #!/bin/sh # -# $OpenBSD: pflogd,v 1.1 2011/07/08 00:50:09 robert Exp $ +# $OpenBSD: pflogd,v 1.2 2011/07/08 21:42:52 robert Exp $ daemon="/sbin/pflogd" @@ -8,4 +8,17 @@ daemon="/sbin/pflogd" pexp="pflogd: \[priv\]" +rc_pre() { + if pfctl -si | grep -q Enabled; then + ifconfig pflog0 create + if ifconfig pflog0; then + ifconfig pflog0 up + else + return 1 + fi + else + return 1 + fi +} + rc_cmd $1