rc.d scripts without a PROVIDE keyword are skipped by rc.subr and thus not executed. rc(8) does not state this clearly, quote: Each script should contain rcorder(8) keywords, especially an appropriate ``PROVIDE'' rcorder(8) is more confusing, as it states, quote: A file may contain zero ``PROVIDE'' lines See message 63aggbF26iusnU1@mid.individual.net and followups on news:comp.unix.bsd.freebsd.misc Fix: Rephrase rc(8) to make clear that scripts require a PROVIDE keyword Rephrase rcorder(8) to make clear that, while rcorder does not require the PROVIDE keyword, the script will not be executed without one.
Responsible Changed From-To: freebsd-doc->keramida I was the one who requested that this is logged as a PR, so I would get a reminder to handle it, so assign it to me.
Release to wild.
rc.subr uses grep to look for rc scripts with '^# PROVIDE:' See "find_local_scripts_new" and "find_local_scripts_old". Scripts in /usr/local/etc/rc.d/* without the "# PROVIDE:" clause are ignored by /etc/rc.
More info here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248865
^Triage: reset stale In Progress status.
I experienced this issue when I added a new service. My service would start and stop manually, but would not start during boot process. I lost hours of my day figuring out why. rcorder(8) states: "A file may contain zero `PROVIDE' lines, in which case it provides no conditions." rc(8) states: "Each script should contain rcorder(8) keywords, especially an appropriate "PROVIDE" entry, and if necessary "REQUIRE" and "BEFORE" keywords.” To my mind, rcorder(8)'s wording implies PROVIDE is optional, while rc(8)'s wording only suggests the importance of PROVIDE but does not discuss the ramifications of leaving it off as rcorder(8) clearly states may be done. The solution here is to unambiguously state in rcorder(8) that the rc system (boot time) will steadfastly refuse to start a service that has no PROVIDE entry, even while a manual start will work.
Created attachment 228335 [details] rcorder(8) and rc(8) patch Document that files with zero PROVIDE keywords are ignored by rc; they are not run during startup.
Update patch to -current. Needs review. https://reviews.freebsd.org/D48876