rc.subr: Fix breakage in the rcrun(8) scripts.
authorSascha Wildner <saw@online.de>
Thu, 10 Jan 2019 18:55:49 +0000 (19:55 +0100)
committerSascha Wildner <saw@online.de>
Thu, 10 Jan 2019 18:55:49 +0000 (19:55 +0100)
0e7badd402459228d38ddfb0e06224b5a3d9fdf8 added an early exit to
rc.subr to avoid sourcing it again. However, some DragonFly bits
in rc.conf are specific to the rc.d script that rc.subr is sourced
from, specifically the contents of the $provide_list variable. The
result was that the varsym variables that rcstart(8) et al. use to
track dependency states were not get set.

Put the setup of $provide_list before the early exit.

etc/rc.subr

index 18a564a..0ce902d 100644 (file)
 #      Operating System dependent/independent variables
 #
 
+if [ -z "$_file" ]; then
+       _file="$0"
+fi
+provide_list=`rcorder -p $_file`
+
 if [ -n "${_rc_subr_loaded}" ]; then
        return
 fi
 
 _rc_subr_loaded="YES"
 
-if [ -z "$_file" ]; then
-       _file="$0"
-fi
-provide_list=`rcorder -p $_file`
-
 SYSCTL="/sbin/sysctl"
 SYSCTL_N="${SYSCTL} -n"
 CMD_OSTYPE="${SYSCTL_N} kern.ostype"