Page MenuHomeFreeBSD

rc.conf: Use user.localbase to determine _localbase
ClosedPublic

Authored by ivy on Aug 9 2025, 9:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 16, 2:55 PM
Unknown Object (File)
Fri, May 15, 3:23 PM
Unknown Object (File)
Fri, May 15, 9:46 AM
Unknown Object (File)
Fri, May 15, 9:45 AM
Unknown Object (File)
Wed, Apr 29, 10:25 AM
Unknown Object (File)
Wed, Apr 29, 10:19 AM
Unknown Object (File)
Mon, Apr 27, 8:07 AM
Unknown Object (File)
Mon, Apr 27, 7:01 AM
Subscribers

Details

Summary

When running an rc.d script outside of boot, ${_localbase} isn't set,
and rc.conf hardcodes the default value to /usr/local. Instead, try
to get the localbase from the user.localbase sysctl, and only fall
back to /usr/local if we can't for some reason.

This fixes e.g. /etc/rc.d/ldconfig when localbase has a non-default
value.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable