Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Feb 2025 03:48:21 +0000
From:      bugzilla-noreply@freebsd.org
To:        doc@FreeBSD.org
Subject:   [Bug 284892] rc(8) is not clear that /usr/local/etc/rc.d/ files are not run until after $early_late_divider
Message-ID:  <bug-284892-9@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D284892

            Bug ID: 284892
           Summary: rc(8) is not clear that /usr/local/etc/rc.d/ files are
                    not run until after $early_late_divider
           Product: Documentation
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Manual Pages
          Assignee: bugs@FreeBSD.org
          Reporter: jeff+freebsd@wagsky.com
                CC: doc@FreeBSD.org

The man page leads off with

       Typically, the
       /usr/local/etc/rc.d/ mechanism is used instead of rc.local  these  d=
ays
       but  if you want to use rc.local, it is still supported.  In this ca=
se,
       it should source /etc/rc.conf and  contain  additional  custom  star=
tup
       code  for your system.  The best way to handle rc.local, however, is=
 to
       separate  it  out  into  rc.d/  style  scripts  and  place  them  un=
der
       /usr/local/etc/rc.d/.

While this is functional for scripts that run after FILESYSTEMS
($early_late_divider), it does not work for scripts that need to run earlie=
r.=20

`rcorder /etc/rc.d/* /usr/local/etc/rc.d/my_script` shows the expected orde=
r,
based on the BEFORE and REQUIRED statements. However, the reality is that it
will not be run until after FILESYSTEMS.

>From /etc/rc

# 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
#
unset system_rc
find_system_scripts
files=3D`rcorder ${skip} ${skip_firstboot} ${system_rc} 2>/dev/null`

_rc_elem_done=3D' '
for _rc_elem in ${files}; do
        run_rc_script ${_rc_elem} ${_boot}
        _rc_elem_done=3D"${_rc_elem_done}${_rc_elem} "

        case "$_rc_elem" in
        */${early_late_divider})        break ;;
        esac
done

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-284892-9>