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, Oct 11, 11:15 AM
Unknown Object (File)
Sat, Oct 11, 11:15 AM
Unknown Object (File)
Sat, Oct 11, 11:15 AM
Unknown Object (File)
Sat, Oct 11, 3:15 AM
Unknown Object (File)
Thu, Oct 9, 9:33 PM
Unknown Object (File)
Fri, Oct 3, 1:47 AM
Unknown Object (File)
Thu, Oct 2, 12:20 AM
Unknown Object (File)
Wed, Oct 1, 11:51 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