freebsd-ports/net/dhcpcd/files/dhcpcd.in
Lucas Toole 128e4bb46e net/dhcpcd: Switch keyword from nojail to nojailvnet in rc script
The keyword was added in 2007 following git history, c7e6df5974. This
is a remnant of the pre-VNET days. dhcpcd is perfectly capable of
running in a VNET jail so relax keyword. This allows dhcpcd to start in
a VNET jail.

PR:			258185
Approved by:		0mp (mentor), philip (mentor)
Differential Revision:	https://reviews.freebsd.org/D32959
2021-11-13 17:06:23 +01:00

43 lines
745 B
Bash

#!/bin/sh
# PROVIDE: dhclient dhcpcd
# KEYWORD: nojailvnet
#
. /etc/rc.subr
. /etc/network.subr
name="dhcpcd"
ifn="$2"
command="%%PREFIX%%/sbin/dhcpcd"
command_args="$ifn"
if [ -n "$ifn" ]; then
specific="$(get_if_var $ifn dhcpcd_flags_IF)"
if [ -z "$flags" -a -n "$specific" ]; then
rc_flags="$specific"
fi
pidfile="/var/run/dhcpcd/dhcpcd-$ifn.pid"
else
pidfile="$($command -P $rc_flags)"
: ${dhcpcd_enable:=NO}
rcvar=dhcpcd_enable
fi
start_precmd="dhcpcd_precmd"
dhcpcd_precmd()
{
# dhcpcd may need local binaries
export PATH=${PATH}:/usr/local/sbin:/usr/local/bin
}
load_rc_config $name
load_rc_config network
if [ -n "$ifn" ]; then
if ! dhcpif $ifn; then
err 1 "$ifn is not enabled for DHCP"
fi
fi
run_rc_command "$1"