NetBSD/etc/rc.d/pf_boot
apb 31edfc6f0f * Add a stop_boot() function in rc.subr, to terminate a multi-user boot
by killing the parent process.  The parent's PID is saved in $RC_PID.
* In all rc.d/* scripts that previously tried to stop the boot,
  replace in-line code with "stop_boot".
* Document this.

This should fix PR 29822.
2007-04-06 14:20:08 +00:00

38 lines
690 B
Bash
Executable File

#!/bin/sh
#
# $NetBSD: pf_boot,v 1.2 2007/04/06 14:20:19 apb Exp $
#
# PROVIDE: pf_boot
# REQUIRE: root beforenetlkm mountcritlocal tty
# BEFORE: network
$_rc_subr_loaded . /etc/rc.subr
name="pf_boot"
rcvar="pf"
start_cmd="pf_boot_start"
stop_cmd=":"
pf_boot_start()
{
if [ "$autoboot" != "yes" ]; then
err 1 "This script should only be executed at boot time."
fi
if [ -f /etc/pf.boot.conf ]; then
/sbin/pfctl -q -f /etc/pf.boot.conf
elif [ -f /etc/defaults/pf.boot.conf ]; then
/sbin/pfctl -q -f /etc/defaults/pf.boot.conf
else
warn "can't load initial pf rules; pf start aborted."
stop_boot
exit 1
fi
/sbin/pfctl -q -e
}
load_rc_config $name
run_rc_command "$1"