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)
Wed, Nov 26, 9:42 PM
Unknown Object (File)
Nov 4 2025, 3:51 PM
Unknown Object (File)
Nov 3 2025, 1:59 AM
Unknown Object (File)
Nov 3 2025, 1:58 AM
Unknown Object (File)
Nov 3 2025, 1:58 AM
Unknown Object (File)
Nov 3 2025, 1:57 AM
Unknown Object (File)
Nov 1 2025, 6:22 PM
Unknown Object (File)
Oct 31 2025, 7:56 PM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 66140
Build 63023: arc lint + arc unit