freebsd-dev/libexec/rc/rc.d/ipnat
Cy Schubert 51da4b19be When booting a system with WITHOUT_IPFILTER the following errors
are encountered at boot time:

rcorder: requirement `ipfs' in file `/etc/rc.d/netif' has no providers.
rcorder: requirement `ipfilter' in file `/etc/rc.d/netif' has no
providers.
rcorder: requirement `ipfilter' in file `/etc/rc.d/netwait' has no
providers.
rcorder: requirement `ipfilter' in file `/etc/rc.d/net_watchdog' has no
providers.
rcorder: requirement `ipfilter' in file `/etc/rc.d/securelevel' has no
providers.

Listing its own requrements in BEFORE rather than use REQUIRE of
non-optional scripts resolves this issue.

The issue was discovered and patched by glebius at Netflix.

Submitted by:	glebius
Reported by:	glebius
MFC after:	1 week
2020-08-11 23:36:38 +00:00

29 lines
506 B
Bash
Executable File

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: ipnat
# KEYWORD: nojailvnet
. /etc/rc.subr
name="ipnat"
desc="user interface to the NAT subsystem"
rcvar="ipnat_enable"
load_rc_config $name
start_cmd="ipnat_start"
stop_cmd="${ipnat_program} -F -C"
reload_cmd="${ipnat_program} -F -C -f ${ipnat_rules}"
extra_commands="reload"
required_files="${ipnat_rules}"
required_modules="ipl:ipfilter"
ipnat_start()
{
echo "Installing NAT rules."
${ipnat_program} -CF -f ${ipnat_rules} ${ipnat_flags}
}
run_rc_command "$1"