aboutsummaryrefslogtreecommitdiff
path: root/libexec/rc
diff options
context:
space:
mode:
authorMina Galić <me+git@igalic.co>2023-03-15 02:52:15 +0000
committerWarner Losh <imp@FreeBSD.org>2023-03-15 02:52:15 +0000
commit3693d9140e05aba9942232df13468f51a6cde136 (patch)
treed6a4a8b91a539104d07410b7515d15470ef5ef3c /libexec/rc
parent44357c18ccb9df24a925d43ccc467f65b9ed6bc6 (diff)
Diffstat (limited to 'libexec/rc')
-rw-r--r--libexec/rc/rc9
-rw-r--r--libexec/rc/rc.subr15
2 files changed, 20 insertions, 4 deletions
diff --git a/libexec/rc/rc b/libexec/rc/rc
index f021251bbd81..8ae048b67c1b 100644
--- a/libexec/rc/rc
+++ b/libexec/rc/rc
@@ -94,7 +94,9 @@ fi
# Do a first pass to get everything up to $early_late_divider so that
# we can do a second pass that includes $local_startup directories
#
-files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* 2>/dev/null`
+unset system_rc
+find_system_scripts
+files=`rcorder ${skip} ${skip_firstboot} ${system_rc} 2>/dev/null`
_rc_elem_done=' '
for _rc_elem in ${files}; do
@@ -106,7 +108,7 @@ for _rc_elem in ${files}; do
esac
done
-unset files local_rc
+unset files local_rc system_rc
# Now that disks are mounted, for each dir in $local_startup
# search for init scripts that use the new rc.d semantics.
@@ -122,7 +124,8 @@ if [ -e ${firstboot_sentinel} ]; then
skip_firstboot=""
fi
-files=`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} 2>/dev/null`
+find_system_scripts
+files=`rcorder ${skip} ${skip_firstboot} ${system_rc} ${local_rc} 2>/dev/null`
for _rc_elem in ${files}; do
case "$_rc_elem_done" in
*" $_rc_elem "*) continue ;;
diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr
index e21504248749..1c01f1cfd071 100644
--- a/libexec/rc/rc.subr
+++ b/libexec/rc/rc.subr
@@ -2083,7 +2083,7 @@ find_local_scripts_new() {
if [ -d "${dir}" ]; then
for file in `grep -l '^# PROVIDE:' ${dir}/* 2>/dev/null`; do
case "$file" in
- *.sample) ;;
+ *.sample|*.pkgsave) ;;
*) if [ -x "$file" ]; then
local_rc="${local_rc} ${file}"
fi
@@ -2094,6 +2094,19 @@ find_local_scripts_new() {
done
}
+find_system_scripts() {
+ system_rc=''
+ for file in /etc/rc.d/*; do
+ case "${file##*/}" in
+ *.pkgsave) ;;
+ *) if [ -x "$file" ]; then
+ system_rc="${system_rc} ${file}"
+ fi
+ ;;
+ esac
+ done
+}
+
# check_required_{before|after} command
# Check for things required by the command before and after its precmd,
# respectively. The two separate functions are needed because some