Index: head/etc/rc.d/ldconfig =================================================================== --- head/etc/rc.d/ldconfig (revision 301003) +++ head/etc/rc.d/ldconfig (revision 301004) @@ -1,106 +1,106 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: ldconfig -# REQUIRE: mountcritremote FILESYSTEMS +# REQUIRE: FILESYSTEMS # BEFORE: DAEMON . /etc/rc.subr name="ldconfig" desc="Configure the shared library cache" 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 case `sysctl -n hw.machine_arch` in armv6) for i in ${ldconfig_localsoft_dirs}; do if [ -d "${i}" ]; then _files=`find ${i} -type f` if [ -n "${_files}" ]; then ldconfigsoft_paths="${ldconfigsoft_paths} `cat ${_files} | sort -u`" fi fi done _LDC="" for i in ${ldconfigsoft_paths}; do if [ -r "${i}" ]; then _LDC="${_LDC} ${i}" fi done check_startmsgs && echo 'Soft Float compatibility ldconfig path:' ${_LDC} ${ldconfig} -soft -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="" for i in /usr/lib/aout ${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" Index: head/etc/rc.d/mountcritremote =================================================================== --- head/etc/rc.d/mountcritremote (revision 301003) +++ head/etc/rc.d/mountcritremote (revision 301004) @@ -1,80 +1,90 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: mountcritremote # REQUIRE: NETWORKING FILESYSTEMS ipsec netwait # KEYWORD: nojail . /etc/rc.subr name="mountcritremote" desc="Mount critical remote filesystems" stop_cmd=":" start_cmd="mountcritremote_start" start_precmd="mountcritremote_precmd" # Mount NFS filesystems if present in /etc/fstab # # XXX When the vfsload() issues with nfsclient support and related sysctls # have been resolved, this block can be removed, and the condition that # skips nfs in the following block (for "other network filesystems") can # be removed. # mountcritremote_precmd() { case "`mount -d -a -t nfs 2> /dev/null`" in *mount_nfs*) # Handle absent nfs client support load_kld -m nfs nfscl || return 1 ;; esac return 0 } mountcritremote_start() { + local mounted_remote_filesystem=false + # Mount nfs filesystems. # case "`/sbin/mount -d -a -t nfs`" in '') ;; *) + mounted_remote_filesystem=true echo -n 'Mounting NFS filesystems:' mount -a -t nfs echo '.' ;; esac # Mount other network filesystems if present in /etc/fstab. case ${extra_netfs_types} in [Nn][Oo]) ;; *) netfs_types="${netfs_types} ${extra_netfs_types}" ;; esac for i in ${netfs_types}; do fstype=${i%:*} fsdecr=${i#*:} [ "${fstype}" = "nfs" ] && continue case "`mount -d -a -t ${fstype}`" in *mount_${fstype}*) + mounted_remote_filesystem=true echo -n "Mounting ${fsdecr} filesystems:" mount -a -t ${fstype} echo '.' ;; esac done - # Cleanup /var again just in case it's a network mount. - /etc/rc.d/cleanvar quietreload - rm -f /var/run/clean_var /var/spool/lock/clean_var + if $mounted_remote_filesystem; then + # Cleanup /var again just in case it's a network mount. + /etc/rc.d/cleanvar quietreload + rm -f /var/run/clean_var /var/spool/lock/clean_var + + # Regenerate the ldconfig hints in case there are additional + # library paths on remote file systems + /etc/rc.d/ldconfig quietstart + fi } load_rc_config $name run_rc_command "$1"