#!/bin/sh # # $FreeBSD$ # # PROVIDE: ldconfig_compat # REQUIRE: mountcritremote ldconfig # BEFORE: DAEMON . /etc/rc.subr name="ldconfig" ldconfig_command="/sbin/ldconfig" start_cmd="ldconfig_start" stop_cmd=":" load_rc_config $name : ${ldconfig_local_dirs="%%PREFIX%%/%%LDCONFIG_DIR%% %%X11BASE%%/%%LDCONFIG_DIR%%"} : ${ldconfig_local32_dirs="%%PREFIX%%/%%LDCONFIG32_DIR%% %%X11BASE%%/%%LDCONFIG32_DIR%%"} ldconfig_start() { _ins= ldconfig=${ldconfig_command} checkyesno ldconfig_insecure && _ins="-i" if [ -x "${ldconfig_command}" ]; then ldconfig_paths="" for i in ${ldconfig_local_dirs}; do if [ -d "${i}" ]; then ldconfig_paths="${ldconfig_paths} `find ${i} -type f`" fi done echo 'Local ldconfig path:' ${ldconfig_paths} ${ldconfig} -m ${_ins} ${ldconfig_paths} case `sysctl -n hw.machine_arch` in amd64) ldconfig32_paths="" for i in ${ldconfig_local32_dirs}; do if [ -d "${i}" ]; then ldconfig32_paths="${ldconfig32_paths} `find ${i} -type f`" fi done echo 'Local 32-bits ldconfig path:' ${ldconfig32_paths} ${ldconfig} -32 -m ${_ins} ${ldconfig32_paths} ;; esac fi } run_rc_command "$1"