rc.conf: Use user.localbase to determine _localbase
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.
Reviewed by: imp, des
Differential Revision: https://reviews.freebsd.org/D51852
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
##############################################################
|
||||
|
||||
# Set default value of _localbase if not previously set
|
||||
: ${_localbase:="$(/sbin/sysctl -n user.localbase 2> /dev/null)"}
|
||||
: ${_localbase:="/usr/local"}
|
||||
|
||||
# rc_debug can't be set here without interferring with rc.subr's setting it
|
||||
|
||||
Reference in New Issue
Block a user