2001-06-16 07:16:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-06-13 22:14:37 +00:00
|
|
|
# $NetBSD: ldconfig,v 1.5 2002/03/22 04:33:58 thorpej Exp $
|
|
|
|
# $FreeBSD$
|
2001-06-16 07:16:14 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: ldconfig
|
2005-01-16 03:12:03 +00:00
|
|
|
# REQUIRE: mountcritremote cleanvar
|
2002-06-13 22:14:37 +00:00
|
|
|
# BEFORE: DAEMON
|
2001-06-16 07:16:14 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="ldconfig"
|
2002-06-13 22:14:37 +00:00
|
|
|
ldconfig_command="/sbin/ldconfig"
|
2001-06-16 07:16:14 +00:00
|
|
|
start_cmd="ldconfig_start"
|
|
|
|
stop_cmd=":"
|
|
|
|
|
|
|
|
ldconfig_start()
|
|
|
|
{
|
2004-01-17 10:40:45 +00:00
|
|
|
_ins=
|
|
|
|
ldconfig=${ldconfig_command}
|
|
|
|
checkyesno ldconfig_insecure && _ins="-i"
|
|
|
|
if [ -x "${ldconfig_command}" ]; then
|
|
|
|
_LDC="/lib /usr/lib"
|
2006-01-08 10:15:31 +00:00
|
|
|
for i in ${ldconfig_local_dirs}; do
|
|
|
|
if [ -d "${i}" ]; then
|
|
|
|
ldconfig_paths="${ldconfig_paths} `find ${i} -type f`"
|
|
|
|
fi
|
|
|
|
done
|
2004-01-17 10:40:45 +00:00
|
|
|
for i in ${ldconfig_paths} /etc/ld-elf.so.conf; do
|
|
|
|
if [ -r "${i}" ]; then
|
|
|
|
_LDC="${_LDC} ${i}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
echo 'ELF ldconfig path:' ${_LDC}
|
|
|
|
${ldconfig} -elf ${_ins} ${_LDC}
|
|
|
|
|
2006-01-08 10:15:31 +00:00
|
|
|
case `sysctl -n hw.machine_arch` in
|
|
|
|
amd64)
|
|
|
|
for i in ${ldconfig_local32_dirs}; do
|
|
|
|
if [ -d "${i}" ]; then
|
|
|
|
ldconfig32_paths="${ldconfig32_paths} `find ${i} -type f`"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
echo '32-bit compatibility ldconfig path:' ${ldconfig32_paths}
|
|
|
|
${ldconfig} -32 -m ${_ins} ${ldconfig32_paths}
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2004-01-17 10:40:45 +00:00
|
|
|
# Legacy aout support for i386 only
|
|
|
|
case `sysctl -n hw.machine_arch` in
|
|
|
|
i386)
|
|
|
|
# Default the a.out ldconfig path.
|
|
|
|
: ${ldconfig_paths_aout=${ldconfig_paths}}
|
|
|
|
_LDC=/usr/lib/aout
|
|
|
|
for i in ${ldconfig_paths_aout} /etc/ld.so.conf; do
|
2003-06-30 15:02:05 +00:00
|
|
|
if [ -r "${i}" ]; then
|
2002-09-17 01:49:00 +00:00
|
|
|
_LDC="${_LDC} ${i}"
|
|
|
|
fi
|
|
|
|
done
|
2004-01-17 10:40:45 +00:00
|
|
|
echo 'a.out ldconfig path:' ${_LDC}
|
|
|
|
${ldconfig} -aout ${_ins} ${_LDC}
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
2001-06-16 07:16:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|