--- /etc/rc.d/rc.orig 2011-06-07 17:56:18.000000000 -0400 +++ /etc/rc.d/rc 2014-05-07 18:38:21.000000000 -0400 @@ -7,6 +7,14 @@ # Miquel van Smoorenburg, # +#------------------------------------------------------- +# Part 1, Custom /var/log/boot.log enablement code +# See https://access.redhat.com/site/solutions/9834 +exec 7>&1 1> >(tee -a /var/log/boot.log) 2>&1 +echo -e "\n================================================================================" +echo -e "Entering runlevel $@ @ $(/bin/date +%Y-%m-%d\ %H:%M:%S)\n" +#------------------------------------------------------- + set -m # check a file to be a correct runlevel script @@ -68,6 +76,16 @@ [ -f /var/lock/subsys/$subsys -o -f /var/lock/subsys/$subsys.init ] \ && continue + #------------------------------------------------------- + # Part 2, Custom /var/log/boot.log enablement code + # Close out process writing to /var/log/boot.log + if [[ $subsys == halt || $subsys == reboot ]]; then + echo "Stopping boot.log logging..." + exec 1>&7 2>&7 7>&- + sleep .5 + fi + #------------------------------------------------------- + # If we're in confirmation mode, get user confirmation if [ -f /var/run/confirm ]; then confirm $subsys