aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
Diffstat (limited to 'libexec')
-rw-r--r--libexec/flua/Makefile7
-rw-r--r--libexec/flua/bootstrap.h6
-rw-r--r--libexec/flua/linit_flua.c5
-rw-r--r--libexec/flua/lposix/Makefile5
-rw-r--r--libexec/flua/lposix/Makefile.inc2
-rw-r--r--libexec/flua/modules/lposix.c (renamed from libexec/flua/lposix/lposix.c)5
-rw-r--r--libexec/flua/modules/lposix.h (renamed from libexec/flua/lposix/lposix.h)0
-rwxr-xr-xlibexec/nuageinit/nuageinit1
-rw-r--r--libexec/rc/rc.conf3
-rw-r--r--libexec/rc/rc.d/Makefile465
-rwxr-xr-xlibexec/rc/rc.d/netwait10
-rwxr-xr-xlibexec/rc/rc.d/zpoolreguid2
-rwxr-xr-xlibexec/rc/rc.d/zpoolupgrade2
-rw-r--r--libexec/rc/tests/rc_subr_test.sh12
14 files changed, 239 insertions, 286 deletions
diff --git a/libexec/flua/Makefile b/libexec/flua/Makefile
index 0d1841f8c3bd..23de404710d0 100644
--- a/libexec/flua/Makefile
+++ b/libexec/flua/Makefile
@@ -16,11 +16,11 @@ FLUA_MODULES+= libjail
.endif
FLUA_MODULES+= libucl
FLUA_MODULES+= liblyaml
-FLUA_MODULES+= lposix
.ifdef BOOTSTRAPPING
-FLUA_MODULES+= libfreebsd/sys/linker
-FLUA_MODULES+= libfreebsd/kenv
+# libfreebsd is generally omitted from the bootstrap flua because its
+# functionality largely assumes a FreeBSD kernel/system headers, so it doesn't
+# really offer functionality that we can use in bootstrap.
CFLAGS+= -I${.CURDIR} -DBOOTSTRAPPING
SHAREDIR= ${WORLDTMP}/legacy/usr/share/flua
@@ -54,6 +54,7 @@ SRCS+= lua.c
# FreeBSD Extensions
.PATH: ${.CURDIR}/modules
SRCS+= linit_flua.c
+SRCS+= lposix.c
CFLAGS+= -I${SRCTOP}/lib/liblua -I${.CURDIR}/modules -I${LUASRC}
CFLAGS+= -DLUA_PROGNAME="\"${PROG}\""
diff --git a/libexec/flua/bootstrap.h b/libexec/flua/bootstrap.h
index 74356d8677b3..caf00518c1e0 100644
--- a/libexec/flua/bootstrap.h
+++ b/libexec/flua/bootstrap.h
@@ -12,10 +12,12 @@
#include <lauxlib.h>
-SET_DECLARE(flua_module_set, const luaL_Reg);
+#define FLUA_MODULE_SETNAME flua_modules
+
+SET_DECLARE(FLUA_MODULE_SETNAME, const luaL_Reg);
#define FLUA_MODULE_DEF(ident, modname, openfn) \
static const luaL_Reg ident = { modname, openfn }; \
- DATA_SET(flua_module_set, ident)
+ DATA_SET(FLUA_MODULE_SETNAME, ident)
#define FLUA_MODULE_NAMED(mod, name) \
FLUA_MODULE_DEF(module_ ## mod, name, luaopen_ ## mod)
diff --git a/libexec/flua/linit_flua.c b/libexec/flua/linit_flua.c
index 161f030923d3..65356c938671 100644
--- a/libexec/flua/linit_flua.c
+++ b/libexec/flua/linit_flua.c
@@ -33,6 +33,7 @@
#include "lualib.h"
#include "lauxlib.h"
+#include "lposix.h"
#include "bootstrap.h"
@@ -54,6 +55,8 @@ static const luaL_Reg loadedlibs[] = {
#if defined(LUA_COMPAT_BITLIB)
{LUA_BITLIBNAME, luaopen_bit32},
#endif
+ /* FreeBSD Extensions */
+ {"posix", luaopen_posix},
{NULL, NULL}
};
@@ -72,7 +75,7 @@ static void __attribute__((constructor)) flua_init_env(void) {
static void flua_setup_mods (lua_State *L) {
const luaL_Reg **flib;
- SET_FOREACH(flib, flua_module_set) {
+ SET_FOREACH(flib, FLUA_MODULE_SETNAME) {
luaL_requiref(L, (*flib)->name, (*flib)->func, 1);
lua_pop(L, 1); /* remove lib */
}
diff --git a/libexec/flua/lposix/Makefile b/libexec/flua/lposix/Makefile
deleted file mode 100644
index 92321d51be9a..000000000000
--- a/libexec/flua/lposix/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-SHLIB_NAME= posix.so
-WARNS?= 3
-
-.include "Makefile.inc"
-.include <bsd.lib.mk>
diff --git a/libexec/flua/lposix/Makefile.inc b/libexec/flua/lposix/Makefile.inc
deleted file mode 100644
index 499e6779e84d..000000000000
--- a/libexec/flua/lposix/Makefile.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-.PATH: ${.PARSEDIR}
-SRCS+= lposix.c
diff --git a/libexec/flua/lposix/lposix.c b/libexec/flua/modules/lposix.c
index 430bb6f28baf..75cdd345aeaa 100644
--- a/libexec/flua/lposix/lposix.c
+++ b/libexec/flua/modules/lposix.c
@@ -21,8 +21,6 @@
#include "lauxlib.h"
#include "lposix.h"
-#include "bootstrap.h"
-
static void
enforce_max_args(lua_State *L, int max)
{
@@ -699,6 +697,3 @@ luaopen_posix(lua_State *L)
return (1);
}
-
-/* Only this one needed in our bootstrap set, it will load the others. */
-FLUA_MODULE(posix);
diff --git a/libexec/flua/lposix/lposix.h b/libexec/flua/modules/lposix.h
index 1aa33f042571..1aa33f042571 100644
--- a/libexec/flua/lposix/lposix.h
+++ b/libexec/flua/modules/lposix.h
diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit
index 29340a3d91ea..f29fa8ba1bac 100755
--- a/libexec/nuageinit/nuageinit
+++ b/libexec/nuageinit/nuageinit
@@ -6,6 +6,7 @@
-- Copyright(c) 2025 Jesús Daniel Colmenares Oviedo <dtxdf@FreeBSD.org>
local nuage = require("nuage")
+local lfs = require("lfs")
local ucl = require("ucl")
local yaml = require("lyaml")
diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf
index 2589e2614c35..c776a815003c 100644
--- a/libexec/rc/rc.conf
+++ b/libexec/rc/rc.conf
@@ -501,7 +501,8 @@ netwait_timeout="60" # Total number of seconds to perform pings.
#netwait_if="" # Wait for active link on each intf in this list.
netwait_if_timeout="30" # Total number of seconds to monitor link state.
netwait_dad="NO" # Wait for DAD to complete
-netwait_dad_timeout="10" # Total number of seconds to wait for DAD.
+netwait_dad_timeout="" # Total number of seconds to wait for DAD, zero
+ # or unset to autodetect
### Miscellaneous network options: ###
icmp_bmcastecho="NO" # respond to broadcast ping packets
diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile
index 03f0933533ca..f6d1a34ceb9e 100644
--- a/libexec/rc/rc.d/Makefile
+++ b/libexec/rc/rc.d/Makefile
@@ -4,6 +4,7 @@ CONFDIR= /etc/rc.d
CONFGROUPS= CONFS
CONFSPACKAGE= rc
+# Files which are always installed and go in the -rc package.
CONFS= DAEMON \
FILESYSTEMS \
LOGIN \
@@ -47,8 +48,6 @@ CONFS= DAEMON \
netoptions \
netwait \
noshutdown \
- ${_nscd} \
- ${_opensm} \
os-release \
pwcheck \
quota \
@@ -77,218 +76,258 @@ CONFS= DAEMON \
var_run \
watchdogd
-CONFGROUPS+= DEVD
-DEVD= devd
-DEVDPACKAGE= devd
-
-CONFGROUPS+= DEVMATCH
-DEVMATCH= devmatch
-DEVMATCHPACKAGE= devmatch
-
-CONFGROUPS+= DHCLIENT
-DHCLIENT= dhclient
-DHCLIENTPACKAGE= dhclient
-
-CONFGROUPS+= GEOM
-GEOM= geli \
- geli2 \
- gptboot
-GEOMPACKAGE= geom
-
-CONFGROUPS+= GGATED
-GGATED= ggated
-GGATEDPACKAGE= ggate
-
-CONFGROUPS+= RESOLVCONF
-RESOLVCONF= resolv
-RESOLVCONFPACKAGE= resolvconf
-
-CONFGROUPS+= CRON
-CRON+= cron
-CRONPACKAGE= cron
-
-CONFGROUPS+= CTL
-CTL= ctld
-CTLPACKAGE= ctl
-
-CONFGROUPS+= NFS
-NFS= lockd \
- mountd \
- nfscbd \
- nfsclient \
- nfsd \
- nfsuserd \
- statd
-NFSPACKAGE= nfs
-
-CONFGROUPS+= NEWSYSLOG
-NEWSYSLOG= newsyslog
-NEWSYSLOGPACKAGE= newsyslog
-
-CONFGROUPS+= POWERD
-POWERD= powerd
-POWERDPACKAGE= powerd
-
-CONFGROUPS+= PPPOED
-PPPOED= pppoed
-PPPOEDPACKAGE= ppp
-
-CONFGROUPS+= SYSLOGD
-SYSLOGD= syslogd
-SYSLOGDPACKAGE= syslogd
-
-CONFGROUPS+= RCMDS
-RCMDS= rwho
-RCMDSPACKAGE= rcmds
+# Groups for files which don't go in -rc, or which depend on src.conf knobs.
.if ${MK_ACCT} != "no" || ${MK_UTMPX} != "no"
-CONFGROUPS+= ACCT
-ACCTPACKAGE= acct
+CONFGROUPS+= ACCT
+ACCTPACKAGE= acct
.if ${MK_ACCT} != "no"
-ACCT+= accounting
+ACCT= accounting
.endif
.if ${MK_UTMPX} != "no"
ACCT+= utx
.endif
.endif
-.if ${MK_ACPI} != "no"
-CONFGROUPS+= ACPI
+CONFGROUPS.${MK_ACPI}+= ACPI
+ACPIPACKAGE= acpi
ACPI= power_profile
-ACPIPACKAGE= acpi
-.endif
-.if ${MK_APM} != "no"
-CONFGROUPS+= APM
-APM+= apm
+CONFGROUPS.${MK_APM}+= APM
+APMPACKAGE= apm
+APM= apm
.if ${MACHINE} == "i386"
APM+= apmd
.endif
-APMPACKAGE= apm
-.endif
-.if ${MK_AUDIT} != "no"
-CONFGROUPS+= AUDIT
-AUDIT+= auditd
-AUDIT+= auditdistd
-AUDITPACKAGE= audit
-.endif
+CONFGROUPS.${MK_AUDIT}+= AUDIT
+AUDITPACKAGE= audit
+AUDIT= auditd \
+ auditdistd
-.if ${MK_AUTOFS} != "no"
-CONFGROUPS+= AUTOFS
+CONFGROUPS.${MK_AUTOFS}+= AUTOFS
+AUTOFSPACKAGE= autofs
AUTOFS= automount \
automountd \
autounmountd
-AUTOFSPACKAGE= autofs
-.endif
-.if ${MK_BLACKLIST} != "no"
-CONFGROUPS+= BLOCKLIST
+CONFGROUPS.${MK_BLACKLIST}+= BLOCKLIST
+BLOCKLISTPACKAGE= blocklist
BLOCKLIST= blacklistd
-BLOCKLISTPACKAGE=blocklist
-.endif
-.if ${MK_BLUETOOTH} != "no"
-CONFGROUPS+= BLUETOOTH
-BLUETOOTH+= bluetooth \
+CONFGROUPS.${MK_BLUETOOTH}+= BLUETOOTH
+BLUETOOTHPACKAGE= bluetooth
+BLUETOOTH= bluetooth \
bthidd \
hcsecd \
rfcomm_pppd_server \
sdpd \
ubthidhci
-BLUETOOTHPACKAGE= bluetooth
-.endif
-.if ${MK_BOOTPARAMD} != "no"
-CONFS+= bootparams
-.endif
+CONFGROUPS.${MK_BOOTPARAMD}+= BOOTPARAMD
+BOOTPARAMD= bootparams
-.if ${MK_BSNMP} != "no"
-CONFGROUPS+= BSNMP
-BSNMP+= bsnmpd
-BSNMPPACKAGE= bsnmp
-.endif
+CONFGROUPS.${MK_BSNMP}+= BSNMP
+BSNMPPACKAGE= bsnmp
+BSNMP= bsnmpd
-.if ${MK_CCD} != "no"
-CONFGROUPS+= CCD
+CONFGROUPS.${MK_CCD}+= CCD
+CCDPACKAGE= ccdconfig
CCD= ccd
-CCDPACKAGE= ccdconfig
-.endif
-.if ${MK_CUSE} != "no"
-CONFGROUPS+= VOSS
-VOSS= virtual_oss
-VOSSPACKAGE= sound
-.endif
+CONFGROUPS+= DEVD
+DEVDPACKAGE= devd
+DEVD= devd
+
+CONFGROUPS+= DEVMATCH
+DEVMATCHPACKAGE= devmatch
+DEVMATCH= devmatch
+
+CONFGROUPS+= DHCLIENT
+DHCLIENTPACKAGE= dhclient
+DHCLIENT= dhclient
+
+CONFGROUPS+= CRON
+CRONPACKAGE= cron
+CRON= cron
-.if ${MK_KERBEROS_SUPPORT} != "no"
-CONFGROUPS+= GSSD
+CONFGROUPS+= CTL
+CTLPACKAGE= ctl
+CTL= ctld
+
+CONFGROUPS+= GEOM
+GEOMPACKAGE= geom
+GEOM= geli \
+ geli2 \
+ gptboot
+
+CONFGROUPS+= GGATED
+GGATEDPACKAGE= ggate
+GGATED= ggated
+
+CONFGROUPS.${MK_KERBEROS_SUPPORT}+=GSSD
+GSSDPACKAGE= gssd
GSSD= gssd
-GSSDPACKAGE= gssd
-.endif
-.if ${MK_HAST} != "no"
-CONFGROUPS+= HAST
+CONFGROUPS.${MK_HAST}+= HAST
+HASTPACKAGE= hast
HAST= hastd
-HASTPACKAGE= hast
-.endif
-.if ${MK_INETD} != "no"
-CONFGROUPS+= INETD
+CONFGROUPS.${MK_INETD}+= INETD
+INETDPACKAGE= inetd
INETD= inetd
-INETDPACKAGE= inetd
-.endif
-.if ${MK_IPFILTER} != "no"
-CONFGROUPS+= IPF
+CONFGROUPS.${MK_IPFILTER}+= IPF
+IPFPACKAGE= ipf
IPF= ipfilter \
ipfs \
ipmon \
ipnat \
ippool
-IPFPACKAGE= ipf
-.endif
-.if ${MK_IPFW} != "no"
-CONFGROUPS+= IPFW
-IPFW= ipfw dnctl
+CONFGROUPS.${MK_IPFW}+= IPFW
+IPFWPACKAGE= ipfw
+IPFW= ipfw \
+ dnctl
.if ${MK_NETGRAPH} != "no"
IPFW+= ipfw_netflow
.endif
-IPFWPACKAGE= ipfw
-# natd is only built when ipfw is built
-CONFGROUPS+= NATD
-NATD+= natd
-NATDPACKAGE= natd
-.endif
-
-.if ${MK_ISCSI} != "no"
-CONFGROUPS+= ISCSI
+CONFGROUPS.${MK_ISCSI}+= ISCSI
+ISCSIPACKAGE= iscsi
ISCSI= iscsictl \
iscsid
-ISCSIPACKAGE= iscsi
-.endif
-.if ${MK_JAIL} != "no"
-CONFGROUPS+= JAIL
-JAIL+= jail
-JAILPACKAGE= jail
-.endif
+# natd is only built when ipfw is built
+CONFGROUPS.${MK_IPFW}+= NATD
+NATDPACKAGE= natd
+NATD= natd
+
+CONFGROUPS.${MK_JAIL}+= JAIL
+JAILPACKAGE= jail
+JAIL= jail
+
+CONFGROUPS.${MK_LPR}+= LP
+LPPACKAGE= lp
+LP= lpd
+
+CONFGROUPS+= NEWSYSLOG
+NEWSYSLOGPACKAGE= newsyslog
+NEWSYSLOG= newsyslog
+
+CONFGROUPS+= NFS
+NFSPACKAGE= nfs
+NFS= lockd \
+ mountd \
+ nfscbd \
+ nfsclient \
+ nfsd \
+ nfsuserd \
+ statd
+
+CONFGROUPS.${MK_NIS}+= NIS
+NISPACKAGE= yp
+NIS= ypbind \
+ ypldap \
+ yppasswdd \
+ ypserv \
+ ypset \
+ ypupdated \
+ ypxfrd \
+ nisdomain
-.if ${MK_LEGACY_CONSOLE} != "no"
-CONFGROUPS+= CONSOLE
-CONSOLE+= moused
-CONSOLE+= msconvd
-CONSOLE+= syscons
-CONSOLEPACKAGE= console-tools
-.endif
+CONFGROUPS.${MK_NS_CACHING}+= NSCD
+NSCD= nscd
-.if ${MK_LPR} != "no"
-CONFGROUPS+= LP
-LP+= lpd
-LPPACKAGE= lp
-.endif
+CONFGROUPS.${MK_NTP}+= NTP
+NTPPACKAGE= ntp
+NTP= ntpd \
+ ntpdate
+
+CONFGROUPS.${MK_NUAGEINIT}+= NUAGEINIT
+NUAGEINITPACKAGE= nuageinit
+NUAGEINIT= nuageinit \
+ nuageinit_post_net \
+ nuageinit_user_data_script
+
+CONFGROUPS.${MK_OFED_EXTRA}+= OPENSM
+OPENSM= opensm
+
+CONFGROUPS.${MK_PF}+= PF
+PFPACKAGE= pf
+PF= pf \
+ pflog \
+ pfsync \
+ ftp-proxy
+
+CONFGROUPS+= POWERD
+POWERDPACKAGE= powerd
+POWERD= powerd
+
+CONFGROUPS.${MK_PPP}+= PPP
+PPPPACKAGE= ppp
+PPP= ppp
+
+CONFGROUPS+= PPPOED
+PPPOEDPACKAGE= ppp
+PPPOED= pppoed
+
+CONFGROUPS+= SYSLOGD
+SYSLOGDPACKAGE= syslogd
+SYSLOGD= syslogd
+
+CONFGROUPS+= RCMDS
+RCMDSPACKAGE= rcmds
+RCMDS= rwho
+
+CONFGROUPS+= RESOLVCONF
+RESOLVCONFPACKAGE= resolvconf
+RESOLVCONF= resolv
+
+CONFGROUPS.${MK_SENDMAIL}+= SENDMAIL
+SENDMAILPACKAGE= sendmail
+SENDMAIL= sendmail
+
+CONFGROUPS.${MK_OPENSSH}+= SSH
+SSHPACKAGE= ssh
+SSH= sshd
+
+CONFGROUPS.${MK_UNBOUND}+= UNBOUND
+UNBOUNDPACKAGE= unbound
+UNBOUND= local_unbound
+
+CONFGROUPS.${MK_VI}+= VI
+VIPACKAGE= vi
+VI= virecover
+
+CONFGROUPS.${MK_CUSE}+= VOSS
+VOSSPACKAGE= sound
+VOSS= virtual_oss
+
+CONFGROUPS.${MK_WIRELESS}+= HOSTAPD
+HOSTAPDPACKAGE= hostapd
+HOSTAPD= hostapd
+
+CONFGROUPS.${MK_WIRELESS}+= WPA
+WPAPACKAGE= wpa
+WPA= wpa_supplicant
+
+CONFGROUPS.${MK_ZFS}+= ZFS
+ZFSPACKAGE= zfs
+ZFS= zfs \
+ zfsbe \
+ zfsd \
+ zfskeys \
+ zpool \
+ zpoolreguid \
+ zpoolupgrade \
+ zvol
+
+CONFGROUPS.${MK_LEGACY_CONSOLE}+=SYSCONS
+SYSCONSPACKAGE= console-tools
+SYSCONS= moused \
+ msconvd \
+ syscons
.if ${MK_KERBEROS} != "no"
.if ${MK_MITKRB5} == "no"
@@ -318,58 +357,10 @@ KRB5PACKAGE= kerberos-kdc
.endif # ${MK_MITKRB5}
.endif # ${MK_KERBEROS}
-.if ${MK_NIS} != "no"
-CONFGROUPS+= YP
-YP= ypbind \
- ypldap \
- yppasswdd \
- ypserv \
- ypset \
- ypupdated \
- ypxfrd \
- nisdomain
-YPPACKAGE= yp
-.endif
-
-.if ${MK_NS_CACHING} != "no"
-_nscd= nscd
-.endif
-
-.if ${MK_NTP} != "no"
-CONFGROUPS+= NTP
-NTP+= ntpd \
- ntpdate
-NTPPACKAGE= ntp
-.endif
-
-.if ${MK_OFED_EXTRA} != "no"
-_opensm= opensm
-.endif
-
.if ${MK_OPENSSL} != "no" && ${MK_OPENSSL_KTLS} != "no"
-CONFS+= tlsclntd \
- tlsservd
-.endif
-
-.if ${MK_OPENSSH} != "no"
-CONFGROUPS+= SSH
-SSH= sshd
-SSHPACKAGE= ssh
-.endif
-
-.if ${MK_PF} != "no"
-CONFGROUPS+= PF
-PF= pf \
- pflog \
- pfsync \
- ftp-proxy
-PFPACKAGE= pf
-.endif
-
-.if ${MK_PPP} != "no"
-CONFGROUPS+= PPP
-PPP= ppp
-PPPPACKAGE= ppp
+CONFGROUPS+= KTLS
+KTLS= tlsclntd \
+ tlsservd
.endif
.if ${MK_INET6} != "no" || ${MK_ROUTED} != "no"
@@ -384,57 +375,9 @@ RIP+= routed
.endif
.endif
-.if ${MK_SENDMAIL} != "no"
-CONFGROUPS+= SMRCD
-SMRCD= sendmail
-SMRCDPACKAGE= sendmail
-.endif
-
-.if ${MK_NUAGEINIT} != "no"
-CONFGROUPS+= NIUAGEINIT
-NIUAGEINIT= nuageinit \
- nuageinit_post_net \
- nuageinit_user_data_script
-NIUAGEINITPACKAGE= nuageinit
-.endif
-
-.if ${MK_UNBOUND} != "no"
-CONFGROUPS+= UNBOUND
-UNBOUND+= local_unbound
-UNBOUNDPACKAGE= unbound
-.endif
-
-.if ${MK_VI} != "no"
-CONFGROUPS+= VI
-VI+= virecover
-VIPACKAGE= vi
-.endif
-
-.if ${MK_WIRELESS} != "no"
-CONFGROUPS+= HOSTAPD
-HOSTAPD= hostapd
-HOSTAPDPACKAGE= hostapd
-
-CONFGROUPS+= WPA
-WPA= wpa_supplicant
-WPAPACKAGE= wpa
-.endif
-
-.if ${MK_ZFS} != "no"
-CONFGROUPS+= ZFS
-ZFS+= zfs
-ZFS+= zfsbe
-ZFS+= zfsd
-ZFS+= zfskeys
-ZFS+= zpool
-ZFS+= zpoolreguid
-ZFS+= zpoolupgrade
-ZFS+= zvol
-ZFSPACKAGE= zfs
-.endif
-
-.for fg in ${CONFGROUPS}
+.for fg in ${CONFGROUPS} ${CONFGROUPS.yes}
${fg}MODE?= ${BINMODE}
+${fg}PACKAGE?= rc
.endfor
.include <bsd.prog.mk>
diff --git a/libexec/rc/rc.d/netwait b/libexec/rc/rc.d/netwait
index b609440a2e4e..05874552cf1c 100755
--- a/libexec/rc/rc.d/netwait
+++ b/libexec/rc/rc.d/netwait
@@ -36,13 +36,15 @@ netwait_start()
err 1 "Nothing to wait for"
fi
- if ! [ "${netwait_if_timeout}" -ge 1 ]; then
+ if ! [ "${netwait_if_timeout:=0}" -ge 1 ]; then
err 1 "netwait_if_timeout must be >= 1"
fi
- if ! [ "${netwait_dad_timeout}" -ge 1 ]; then
- err 1 "netwait_dad_timeout must be >= 1"
+ if ! check_kern_features inet6; then
+ netwait_dad="NO"
+ elif ! [ "${netwait_dad_timeout:=0}" -ge 1 ]; then
+ netwait_dad_timeout=$(($(sysctl -n net.inet6.ip6.dad_count)+1))
fi
- if ! [ "${netwait_timeout}" -ge 1 ]; then
+ if ! [ "${netwait_timeout:=0}" -ge 1 ]; then
err 1 "netwait_timeout must be >= 1"
fi
diff --git a/libexec/rc/rc.d/zpoolreguid b/libexec/rc/rc.d/zpoolreguid
index f94630d9283f..c19f52d3d702 100755
--- a/libexec/rc/rc.d/zpoolreguid
+++ b/libexec/rc/rc.d/zpoolreguid
@@ -2,7 +2,7 @@
# PROVIDE: zpoolreguid
# REQUIRE: zpool
-# BEFORE: mountcritlocal
+# BEFORE: FILESYSTEMS
# KEYWORD: firstboot nojail
. /etc/rc.subr
diff --git a/libexec/rc/rc.d/zpoolupgrade b/libexec/rc/rc.d/zpoolupgrade
index 1435cba7199c..5e623a9c2bf0 100755
--- a/libexec/rc/rc.d/zpoolupgrade
+++ b/libexec/rc/rc.d/zpoolupgrade
@@ -2,7 +2,7 @@
# PROVIDE: zpoolupgrade
# REQUIRE: zpool
-# BEFORE: mountcritlocal
+# BEFORE: FILESYSTEMS
# KEYWORD: firstboot nojail
. /etc/rc.subr
diff --git a/libexec/rc/tests/rc_subr_test.sh b/libexec/rc/tests/rc_subr_test.sh
index fe6d3b8264c9..9ddd13b61a7c 100644
--- a/libexec/rc/tests/rc_subr_test.sh
+++ b/libexec/rc/tests/rc_subr_test.sh
@@ -26,6 +26,17 @@
# SUCH DAMAGE.
#
+atf_test_case no_cycles
+no_cycles_head()
+{
+ atf_set "descr" "Verify that /etc/rc.d/* contains no cycles"
+}
+
+no_cycles_body()
+{
+ atf_check -e empty -o ignore rcorder /etc/rc.d/*
+}
+
atf_test_case oomprotect_all
oomprotect_all_head()
{
@@ -130,6 +141,7 @@ EOF
atf_init_test_cases()
{
+ atf_add_test_case no_cycles
atf_add_test_case oomprotect_all
atf_add_test_case oomprotect_yes
atf_add_test_case wait_for_pids_progress