]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/rc.d/ldconfig
This commit was generated by cvs2svn to compensate for changes in r136136,
[FreeBSD/FreeBSD.git] / etc / rc.d / ldconfig
1 #!/bin/sh
2 #
3 # $NetBSD: ldconfig,v 1.5 2002/03/22 04:33:58 thorpej Exp $
4 # $FreeBSD$
5 #
6
7 # PROVIDE: ldconfig
8 # REQUIRE: mountcritremote
9 # BEFORE:  DAEMON
10 # KEYWORD: FreeBSD
11
12 . /etc/rc.subr
13
14 name="ldconfig"
15 ldconfig_command="/sbin/ldconfig"
16 start_cmd="ldconfig_start"
17 stop_cmd=":"
18
19 ldconfig_start()
20 {
21         _ins=
22         ldconfig=${ldconfig_command}
23         checkyesno ldconfig_insecure && _ins="-i"
24         if [ -x "${ldconfig_command}" ]; then
25                 _LDC="/lib /usr/lib"
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
34                 # Legacy aout support for i386 only
35                 case `sysctl -n hw.machine_arch` in
36                 i386)
37                         # Default the a.out ldconfig path.
38                         : ${ldconfig_paths_aout=${ldconfig_paths}}
39                         _LDC=/usr/lib/aout
40                         for i in ${ldconfig_paths_aout} /etc/ld.so.conf; do
41                                 if [ -r "${i}" ]; then
42                                         _LDC="${_LDC} ${i}"
43                                 fi
44                         done
45                         echo 'a.out ldconfig path:' ${_LDC}
46                         ${ldconfig} -aout ${_ins} ${_LDC}
47                         ;;
48                 esac
49         fi
50 }
51
52 load_rc_config $name
53 run_rc_command "$1"