freebsd-dev/etc/rc.d/ldconfig
Doug Barton 70d4ef1ea1 In regards to the "Starting foo:" type messages at boot time, create and
employ a more generic solution, and use it in the individual rc.d scripts
that also have an $rc_quiet test:

1. Add check_startmsgs() to rc.subr.
2. In the rc.d scripts that use rc_quiet (and rc.subr) substitute
variations of [ -z "$rc_quiet" ] with check_startmsgs
3. In savecore add a trailing '.' to the end of the message to make it
more consistent with other scripts.
4. In newsyslog remove a : before the terminal '.' since we do not expect
there to be anything printed out in between to make it more consistent.
5. In the following scripts change "quotes" to 'quotes' where no variables
exist in the message: savecore pf newsyslog
6. In the following scripts substitute if/then/fi for the simpler (and
more consistent) check_startmsgs &&: faith stf
7. In the following scripts separate the "Starting foo:" from the terminal
'.' to make them more consistent: moused hostname pf
8. In nfsclient move the message to its own line to avoid a style bug
9. In pf rc_quiet does not apply to the _stop method, so remove the
test there.
10. In motd add 'quotes' around the terminal '.' for consistency
2009-10-10 22:17:03 +00:00

84 lines
1.8 KiB
Bash
Executable File

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: ldconfig
# REQUIRE: mountcritremote cleanvar
# BEFORE: DAEMON
. /etc/rc.subr
name="ldconfig"
ldconfig_command="/sbin/ldconfig"
start_cmd="ldconfig_start"
stop_cmd=":"
ldconfig_start()
{
local _files _ins
_ins=
ldconfig=${ldconfig_command}
checkyesno ldconfig_insecure && _ins="-i"
if [ -x "${ldconfig_command}" ]; then
_LDC="/lib /usr/lib"
for i in ${ldconfig_local_dirs}; do
if [ -d "${i}" ]; then
_files=`find ${i} -type f`
if [ -n "${_files}" ]; then
ldconfig_paths="${ldconfig_paths} `cat ${_files} | sort -u`"
fi
fi
done
for i in ${ldconfig_paths} /etc/ld-elf.so.conf; do
if [ -r "${i}" ]; then
_LDC="${_LDC} ${i}"
fi
done
check_startmsgs && echo 'ELF ldconfig path:' ${_LDC}
${ldconfig} -elf ${_ins} ${_LDC}
case `sysctl -n hw.machine_arch` in
amd64)
for i in ${ldconfig_local32_dirs}; do
if [ -d "${i}" ]; then
_files=`find ${i} -type f`
if [ -n "${_files}" ]; then
ldconfig32_paths="${ldconfig32_paths} `cat ${_files} | sort -u`"
fi
fi
done
_LDC=""
for i in ${ldconfig32_paths}; do
if [ -r "${i}" ]; then
_LDC="${_LDC} ${i}"
fi
done
check_startmsgs &&
echo '32-bit compatibility ldconfig path:' ${_LDC}
${ldconfig} -32 -m ${_ins} ${_LDC}
;;
esac
# 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
if [ -r "${i}" ]; then
_LDC="${_LDC} ${i}"
fi
done
check_startmsgs && echo 'a.out ldconfig path:' ${_LDC}
${ldconfig} -aout ${_ins} ${_LDC}
;;
esac
fi
}
load_rc_config $name
run_rc_command "$1"