Index: head/etc/rc.d/bgfsck =================================================================== --- head/etc/rc.d/bgfsck (revision 179944) +++ head/etc/rc.d/bgfsck (revision 179945) @@ -1,42 +1,42 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: bgfsck # REQUIRE: cron devfs syslogd # KEYWORD: nojail . /etc/rc.subr name="background-fsck" rcvar="background_fsck" start_cmd="bgfsck_start" stop_cmd=":" bgfsck_start () { if [ -z "${rc_force}" ]; then background_fsck_delay=${background_fsck_delay:=0} else background_fsck_delay=0 fi if [ ${background_fsck_delay} -lt 0 ]; then echo "Background file system checks delayed indefinitly" return 0 fi bgfsck_msg='Starting background file system checks' if [ "${background_fsck_delay}" -gt 0 ]; then bgfsck_msg="${bgfsck_msg} in ${background_fsck_delay} seconds" fi if [ -z "${rc_force}" ]; then - echo "${bgfsck_msg}." + [ -z "${rc_quiet}" ] && echo "${bgfsck_msg}." fi (sleep ${background_fsck_delay}; nice -4 fsck -B -p) 2>&1 | \ logger -p daemon.notice -t fsck & } load_rc_config $name run_rc_command "$1" Index: head/etc/rc.d/fsck =================================================================== --- head/etc/rc.d/fsck (revision 179944) +++ head/etc/rc.d/fsck (revision 179945) @@ -1,78 +1,78 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: fsck # REQUIRE: localswap # KEYWORD: nojail . /etc/rc.subr name="fsck" start_cmd="fsck_start" stop_cmd=":" fsck_start() { if [ "$autoboot" = no ]; then echo "Fast boot: skipping disk checks." elif [ ! -r /etc/fstab ]; then echo "Warning! No /etc/fstab: skipping disk checks." elif [ "$autoboot" = yes ]; then # During fsck ignore SIGQUIT trap : 3 - echo "Starting file system checks:" + [ -z "${rc_quiet}" ] && echo "Starting file system checks:" if checkyesno background_fsck; then fsck -F -p else fsck -p fi case $? in 0) ;; 2) stop_boot ;; 4) echo "Rebooting..." reboot echo "Reboot failed; help!" stop_boot ;; 8) if checkyesno fsck_y_enable; then echo "File system preen failed, trying fsck -y." fsck -y case $? in 0) ;; *) echo "Automatic file system check failed; help!" stop_boot ;; esac else echo "Automatic file system check failed; help!" stop_boot fi ;; 12) echo "Boot interrupted." stop_boot ;; 130) stop_boot ;; *) echo "Unknown error; help!" stop_boot ;; esac fi } load_rc_config $name run_rc_command "$1" Index: head/etc/rc.d/hostid =================================================================== --- head/etc/rc.d/hostid (revision 179944) +++ head/etc/rc.d/hostid (revision 179945) @@ -1,97 +1,99 @@ #!/bin/sh # # Copyright (c) 2007 Pawel Jakub Dawidek # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # $FreeBSD$ # # PROVIDE: hostid # REQUIRE: root # BEFORE: mountcritlocal # KEYWORD: nojail . /etc/rc.subr name="hostid" start_cmd="hostid_start" stop_cmd=":" reset_cmd="hostid_reset" extra_commands="reset" rcvar="hostid_enable" hostid_set() { uuid=$1 # Generate hostid based on hostuuid - take first four bytes from md5(uuid). id=`echo -n $uuid | /sbin/md5` id="0x${id%????????????????????????}" + # Set both kern.hostuuid and kern.hostid. - echo "Setting hostuuid: ${uuid}." + # + [ -z "${rc_quiet}" ] && echo "Setting hostuuid: ${uuid}." ${SYSCTL_W} kern.hostuuid="${uuid}" >/dev/null - echo "Setting hostid: ${id}." + [ -z "${rc_quiet}" ] && echo "Setting hostid: ${id}." ${SYSCTL_W} kern.hostid=${id} >/dev/null } hostid_hardware() { uuid=`kenv -q smbios.system.uuid` x="[0-9a-f]" y=$x$x$x$x case "${uuid}" in $y$y-$y-$y-$y-$y$y$y) echo "${uuid}" ;; esac } hostid_reset() { # First look for UUID in hardware. uuid=`hostid_hardware` if [ -z ${uuid} ]; then # If not found, fall back to software-generated UUID. uuid=`uuidgen` fi # Store newly generated UUID in ${hostid_file}. echo $uuid > ${hostid_file} if [ $? -ne 0 ]; then warn "could not store hostuuid in ${hostid_file}." fi hostid_set $uuid } hostid_start() { # If ${hostid_file} already exists, we take UUID from there. if [ -r ${hostid_file} ]; then hostid_set `cat ${hostid_file}` else # No hostid file, generate UUID. hostid_reset fi } load_rc_config $name run_rc_command "$1" Index: head/etc/rc.d/hostname =================================================================== --- head/etc/rc.d/hostname (revision 179944) +++ head/etc/rc.d/hostname (revision 179945) @@ -1,80 +1,80 @@ #!/bin/sh # # Copyright (c) 2003 The FreeBSD Project. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # $FreeBSD$ # # PROVIDE: hostname # REQUIRE: FILESYSTEMS # BEFORE: netif . /etc/rc.subr . /etc/network.subr name="hostname" start_cmd="hostname_start" stop_cmd=":" hostname_start() { # If we are not inside a jail, set the host name if it is not already set. # If we are inside a jail, set the host name even if it is already set, # but first check if it is permitted. # if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then if [ `$SYSCTL_N security.jail.set_hostname_allowed` -eq 0 ]; then return fi elif [ -n "`/bin/hostname -s`" ]; then return else # If we're not in a jail and rc.conf doesn't specify a # hostname, see if we can get one from kenv. # if [ -z "${hostname}" -a \ -n "`/bin/kenv dhcp.host-name 2> /dev/null`" ]; then hostname=`/bin/kenv dhcp.host-name` fi fi # Have we got a hostname yet? # if [ -z "${hostname}" ]; then # Null hostname is probably OK if DHCP is in use. # if [ -z "`list_net_interfaces dhcp`" ]; then warn "\$hostname is not set -- see ${rcvar_manpage}." fi return fi # All right, it is safe to invoke hostname(1) now. # - echo "Setting hostname: ${hostname}." + [ -z "${rc_quiet}" ] && echo "Setting hostname: ${hostname}." /bin/hostname "${hostname}" } load_rc_config $name run_rc_command "$1" Index: head/etc/rc.d/ldconfig =================================================================== --- head/etc/rc.d/ldconfig (revision 179944) +++ head/etc/rc.d/ldconfig (revision 179945) @@ -1,82 +1,84 @@ #!/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 - echo 'ELF ldconfig path:' ${_LDC} + [ -z "${rc_quiet}" ] && 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 - echo '32-bit compatibility ldconfig path:' ${_LDC} + [ -z "${rc_quiet}" ] && + 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 - echo 'a.out ldconfig path:' ${_LDC} + [ -z "${rc_quiet}" ] && + 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/motd =================================================================== --- head/etc/rc.d/motd (revision 179944) +++ head/etc/rc.d/motd (revision 179945) @@ -1,49 +1,49 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: motd # REQUIRE: mountcritremote # BEFORE: LOGIN . /etc/rc.subr name="motd" rcvar="update_motd" start_cmd="motd_start" stop_cmd=":" PERMS="644" motd_start() { # Update kernel info in /etc/motd # Must be done *before* interactive logins are possible # to prevent possible race conditions. # - echo -n 'Updating motd' + [ -z "${rc_quiet}" ] && echo -n 'Updating motd:' if [ ! -f /etc/motd ]; then install -c -o root -g wheel -m ${PERMS} /dev/null /etc/motd fi if [ ! -w /etc/motd ]; then - echo ' ... /etc/motd is not writable, update failed.' + echo ' /etc/motd is not writable, update failed.' return fi T=`mktemp -t motd` uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T} awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> ${T} cmp -s $T /etc/motd || { cp $T /etc/motd chmod ${PERMS} /etc/motd } rm -f $T - echo . + [ -z "${rc_quiet}" ] && echo . } load_rc_config $name run_rc_command "$1" Index: head/etc/rc.d/moused =================================================================== --- head/etc/rc.d/moused (revision 179944) +++ head/etc/rc.d/moused (revision 179945) @@ -1,73 +1,71 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: moused # REQUIRE: DAEMON cleanvar # KEYWORD: nojail . /etc/rc.subr name=moused rcvar=`set_rcvar` command="/usr/sbin/${name}" start_cmd="moused_start" pidprefix="/var/run/moused" pidfile="${pidprefix}.pid" pidarg= load_rc_config $name # Set the pid file and variable name. The second argument, if it exists, is # expected to be the mouse device. # if [ -n "$2" ]; then eval moused_$2_enable=\${moused_$2_enable-${moused_nondefault_enable}} rcvar=`set_rcvar moused_$2` pidfile="${pidprefix}.$2.pid" pidarg="-I $pidfile" fi moused_start() { local ms myflags myport mytype # Set the mouse device and get any related variables. If # a moused device has been specified on the commandline, then # rc.conf(5) variables defined for that device take precedence # over the generic moused_* variables. The only exception is # the moused_port variable, which if not defined sets it to the # passed in device name. # ms=$1 if [ -n "$ms" ]; then eval myflags=\${moused_${ms}_flags-$moused_flags} eval myport=\${moused_${ms}_port-/dev/$ms} eval mytype=\${moused_${ms}_type-$moused_type} else ms="default" myflags="$moused_flags" myport="$moused_port" mytype="$moused_type" fi - echo -n "Starting ${ms} moused:" + [ -z "${rc_quiet}" ] && echo -n "Starting ${ms} moused." /usr/sbin/moused ${myflags} -p ${myport} -t ${mytype} ${pidarg} mousechar_arg= case ${mousechar_start} in [Nn][Oo] | '') ;; *) - echo -n ' mousechar_start' mousechar_arg="-M ${mousechar_start}" ;; esac for ttyv in /dev/ttyv* ; do vidcontrol < ${ttyv} ${mousechar_arg} -m on done - echo '.' } run_rc_command $* Index: head/etc/rc.d/newsyslog =================================================================== --- head/etc/rc.d/newsyslog (revision 179944) +++ head/etc/rc.d/newsyslog (revision 179945) @@ -1,26 +1,26 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: newsyslog # REQUIRE: cleanvar mountcritremote . /etc/rc.subr name="newsyslog" rcvar=`set_rcvar` required_files="/etc/newsyslog.conf" command="/usr/sbin/${name}" start_cmd="newsyslog_start" stop_cmd=":" newsyslog_start() { - echo -n "Creating and/or trimming log files:" + [ -z "${rc_quiet}" ] && echo -n "Creating and/or trimming log files:" ${command} ${rc_flags} - echo "." + [ -z "${rc_quiet}" ] && echo "." } load_rc_config $name run_rc_command "$1" Index: head/etc/rc.d/savecore =================================================================== --- head/etc/rc.d/savecore (revision 179944) +++ head/etc/rc.d/savecore (revision 179945) @@ -1,65 +1,65 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: savecore # REQUIRE: syslogd # BEFORE: SERVERS # KEYWORD: nojail . /etc/rc.subr name="savecore" start_cmd="savecore_start" start_precmd="savecore_prestart" stop_cmd=":" savecore_prestart() { # ${DUMPDIR} should be a directory or a symbolic link # to the crash directory if core dumps are to be saved. # DUMPDIR="${dumpdir:-/var/crash}" # Quit if we have no dump device case ${dumpdev} in [Nn][Oo] | '') debug 'No dump device. Quitting.' return 1 ;; [Aa][Uu][Tt][Oo]) dumpdev=`/bin/realpath /dev/dumpdev` ;; esac # If there is no crash directory set it now case ${dumpdir} in '') dumpdir='/var/crash' ;; [Nn][Oo]) dumpdir='NO' ;; esac if [ ! -c "${dumpdev}" ]; then warn "Dump device does not exist. Savecore not run." return 1 fi if [ ! -d "${dumpdir}" ]; then warn "Dump directory does not exist. Savecore not run." return 1 fi return 0 } savecore_start() { - echo "Checking for core dump on ${dumpdev}..." + [ -z "${rc_quiet}" ] && echo "Checking for core dump on ${dumpdev}..." savecore ${savecore_flags} ${DUMPDIR} ${dumpdev} } load_rc_config $name run_rc_command "$1"