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)
Mon, Jan 12, 6:19 AM
Unknown Object (File)
Sat, Jan 3, 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
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
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