xref: /dragonfly/etc/rc.d/ldconfig (revision 0cfebe3d)
1#!/bin/sh
2#
3# $NetBSD: ldconfig,v 1.5 2002/03/22 04:33:58 thorpej Exp $
4# $FreeBSD: src/etc/rc.d/ldconfig,v 1.7 2003/06/30 15:02:05 trhodes Exp $
5# $DragonFly: src/etc/rc.d/ldconfig,v 1.7 2005/11/19 21:47:32 swildner Exp $
6#
7
8# PROVIDE: ldconfig
9# REQUIRE: mountcritremote
10# BEFORE:  DAEMON
11
12. /etc/rc.subr
13
14name="ldconfig"
15ldconfig_command="/sbin/ldconfig"
16start_cmd="ldconfig_start"
17stop_cmd=":"
18
19ldconfig_start()
20{
21		_ins=
22		ldconfig=${ldconfig_command}
23		checkyesno ldconfig_insecure && _ins="-i"
24		if [ -x "${ldconfig_command}" ]; then
25			_LDC="/usr/lib /usr/lib/gcc*"
26			for i in ${ldconfig_paths} /etc/ld-elf.so.conf; do
27				if [ -r "${i}" ]; then
28					_LDC="${_LDC} ${i}"
29				fi
30			done
31			echo 'ELF ldconfig path:' ${_LDC}
32			${ldconfig} -elf ${_ins} ${_LDC}
33		fi
34}
35
36load_rc_config $name
37run_rc_command "$1"
38