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
F175445708: D51852.id160154.diff
Sat, Oct 10, 10:18 PM
F175444398: D51852.id160139.diff
Sat, Oct 10, 10:06 PM
Unknown Object (File)
Sun, Oct 4, 10:00 AM
Unknown Object (File)
Sun, Sep 27, 3:36 PM
Unknown Object (File)
Sep 11 2026, 6:26 AM
Unknown Object (File)
Sep 10 2026, 2:15 PM
Unknown Object (File)
Sep 8 2026, 11:37 PM
Unknown Object (File)
Sep 5 2026, 9:55 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 66140
Build 63023: arc lint + arc unit