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, Mar 4, 3:44 PM
Unknown Object (File)
Sun, Mar 1, 6:18 AM
Unknown Object (File)
Feb 9 2026, 5:29 AM
Unknown Object (File)
Jan 12 2026, 6:19 AM
Unknown Object (File)
Jan 3 2026, 6:42 PM
Unknown Object (File)
Dec 16 2025, 8:46 PM
Unknown Object (File)
Dec 12 2025, 3:17 PM
Unknown Object (File)
Nov 26 2025, 9:42 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 Not Applicable
Unit
Tests Not Applicable