Date: Wed, 19 Feb 2025 03:48:21 +0000 From: bugzilla-noreply@freebsd.org To: bugs@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-227@https.bugs.freebsd.org/bugzilla/>
index | next in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=284892 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 days but if you want to use rc.local, it is still supported. In this case, it should source /etc/rc.conf and contain additional custom startup 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 under /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 earlier. `rcorder /etc/rc.d/* /usr/local/etc/rc.d/my_script` shows the expected order, 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=`rcorder ${skip} ${skip_firstboot} ${system_rc} 2>/dev/null` _rc_elem_done=' ' for _rc_elem in ${files}; do run_rc_script ${_rc_elem} ${_boot} _rc_elem_done="${_rc_elem_done}${_rc_elem} " case "$_rc_elem" in */${early_late_divider}) break ;; esac done -- You are receiving this mail because: You are the assignee for the bug.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-284892-227>
