Index: bootscripts/contrib/lsb-v3/init.d/rc
===================================================================
--- bootscripts/contrib/lsb-v3/init.d/rc	(revision 1c4800743d22d675ccfa48364d8aa558e8b7407c)
+++ bootscripts/contrib/lsb-v3/init.d/rc	(revision 1c4800743d22d675ccfa48364d8aa558e8b7407c)
@@ -0,0 +1,193 @@
+#!/bin/sh
+# Begin $RC_BASE/init.d/rc
+
+# Get the configuration file
+# All changes are to occur in the config file
+. /etc/sysconfig/rc
+
+# These 3 signals will not cause our script to exit
+trap "" INT QUIT TSTP
+
+# Simple sanity check - rc only takes one argument
+if [ "${#}" -ne 1 ]; then
+    echo "Usage: ${0} <runlevel>" >&2
+    exit 1
+fi
+
+# Do not use the RUNLEVEL and PREVLEVEL variables provided by init so 
+# that they can be modified and alternate directories (sysinit) can 
+# be used without affecting init
+runlevel="${1}"
+prevlevel="${PREVLEVEL}"
+
+# Just in case - some flavors of init don't set PREVLEVEL to 'N'
+if [ "${prevlevel}" = "" ]; then
+    prevlevel="N"
+fi
+
+# Mount a tmpfs to store boot accounting information
+if [ "${runlevel}" = "sysinit" -a "${TEMPFS_MOUNT}" != "" ]; then
+    mount -n -t tmpfs tmpfs "${TEMPFS_MOUNT}" -o mode=600
+fi
+
+# Provide an interactive prompt (if requested)
+if [ "${runlevel}" = "sysinit" -a "${iprompt}" = "yes" ]; then
+    # ash does not accept t and n flags for read
+    ls -l /bin/sh | grep "/ash"
+    if [ "${?}" -eq "0" ]; then
+        # We are using ash
+        echo -e -n "${WARNING}WARNING:  Either bash or zsh is required"
+        echo -e "${WARNING} for interactive startup.\n"
+        sleep 3
+    else
+        echo ""
+        # dcol and icol are spaces before the message to center the
+        # message on screen.
+        dcol=$(( $(( ${COLUMNS} - ${dlen} )) / 2 ))
+        icol=$(( $(( ${COLUMNS} - ${ilen} )) / 2 ))
+        echo -e "\\033[${dcol}G${welcome_message}"
+        echo -e "\\033[${icol}G${i_message}${NORMAL}"
+        echo ""
+        read -t "${itime}" -n 1 interactive 2>&1 > /dev/null
+        if [ "${interactive}" = "I" -o "${interactive}" = "i" ]; then
+            echo -n -e "${CURS_UP}"
+            echo -e "${INFO}Interactive boot selected...${NORMAL}"
+            echo "interactive=I" > "${TEMPFS_MOUNT}/.interactive-start"
+        fi
+    fi
+fi
+
+
+# Verify that the directory exists
+if [ ! -d "${RC_BASE}/rc${runlevel}.d" ]; then
+    echo -n "${WARNING}${RC_BASE}/rc${runlevel}.d does not exist."
+    echo "${NORMAL}"
+    exit 1
+fi
+
+# Source the interactive state file if it exists
+if [ "${runlevel}" != "sysinit" -a -f "${TEMPFS_MOUNT}/.interactive-start" ]; then
+    . "${TEMPFS_MOUNT}/.interactive-start"
+fi
+
+# Prompt for interactive startup after completing sysinit
+if [ "${interactive}" = "I" -a "${runlevel}" != "sysinit" -a \
+    "${runlevel}" != "0" -a "${runlevel}" != "6" ]; then
+    echo -n -e "Proceed with interactive starup of runlevel "
+    echo -n -e "${INFO}${runlevel}${NORMAL}?"
+    echo -n -e "(${FAILURE}y${NORMAL})es/(${FAILURE}n${NORMAL})o "
+    read -n 1 go_on
+    echo ""
+    if [ "${go_on}" = "n" ]; then
+        # don't continue
+        exit 0
+    fi
+fi
+
+
+# Attempt to stop all services started in the previous runlevel,
+# that are stopped in this runlevel
+if [ "${prevlevel}" != "N" ]; then
+    for link in $(ls -v ${RC_BASE}/rc${runlevel}.d/K* 2> /dev/null)
+    do
+        # Check to see if link is a valid symlink
+        if [ ! -f ${link} ]; then
+                echo -e "${WARNING}${link} is not a valid symlink."
+                continue # go on to the next K* link
+        fi
+
+        # Check to see if link is executable
+        if [ ! -x ${link} ]; then
+                echo -e "${WARNING}${link} is not executable, skipping."
+                continue # go on to the next K* link
+        fi
+
+        script=${link#$RC_BASE/rc$runlevel.d/K[0-9][0-9]}
+        prev_start=$RC_BASE/rc$prevlevel.d/S[0-9][0-9]$script
+        sysinit_start=$RC_BASE/rcsysinit.d/S[0-9][0-9]$script
+
+        if [ "${runlevel}" != "0" -a "${runlevel}" != "6" ]; then
+            if [ ! -f ${prev_start} ] && [ ! -f ${sysinit_start} ]; then
+                echo -e -n "${WARNING}WARNING:\n\n${link} can't be"
+                echo -e "${WARNING} executed because it was not"
+                echo -e -n "${WARNING} not started in the previous"
+                echo -e "${WARNING} runlevel (${prevlevel})."
+                echo -e "${NORMAL}"
+                continue
+            fi
+        fi
+        ${link} stop
+        error_value=${?}
+
+        if [ "${error_value}" != "0" ]; then
+            print_error_msg
+        fi
+    done
+fi
+
+# Start all functions in this runlevel if they weren't started in
+# the previous runlevel
+for link in $( ls -v ${RC_BASE}/rc${runlevel}.d/S* 2> /dev/null)
+do
+    if [ "${prevlevel}" != "N" ]; then
+        script=${link#$RC_BASE/rc$runlevel.d/S[0-9][0-9]}
+        stop=$RC_BASE/rc$runlevel.d/K[0-9][0-9]$script
+        prev_start=$RC_BASE/rc$prevlevel.d/S[0-9][0-9]$script
+
+        [ -f ${prev_start} ] && [ ! -f ${stop} ] && continue
+    fi
+
+    # Check to see if link is a valid symlink
+    if [ ! -f ${link} ]; then
+        echo -e "${WARNING}${link} is not a valid symlink."
+        continue # go on to the next K* link
+    fi
+
+    # Check to see if link is executable
+    if [ ! -x ${link} ]; then
+        echo -e "${WARNING}${link} is not executable, skipping."
+        continue # go on to the next K* link
+    fi
+
+    case ${runlevel} in
+        0|6)
+            ${link} stop
+        ;;
+
+        *)
+            if [ "${interactive}" = "I" -o "${interactive}" = "i" ]; then
+                echo -e -n "${WARNING}Start ${INFO}${link} ${WARNING}?"
+                echo -e -n "${NORMAL}(${FAILURE}y${NORMAL})es/(${FAILURE}n${NORMAL})o "
+                read -n 1 startit 2>&1 > /dev/null
+                echo ""
+                if [ "${startit}" = "y" -o "${startit}" = "Y" ]; then
+                    ${link} start
+                else
+                    echo -e -n "${WARNING}Not starting ${INFO}${link}"
+                    echo -e "${WARNING}.${NORMAL}\n"
+                fi
+            else
+                ${link} start
+            fi
+        ;;
+    esac
+    error_value=${?}
+
+    if [ "${error_value}" -gt "1" ]; then
+        print_error_msg
+    fi
+done
+
+# Strip apply time to the logs, strip out any color codes and dump 
+# the log to /var/log/boot.log
+if [ -f "${TEMPFS_MOUNT}/.bootlog" -a "${runlevel}" != "sysinit" ]; then
+    # Remove any color codes from the temp log file
+    sed -i 's@\\033\[[0-9];[0-9][0-9]m@@g' "${TEMPFS_MOUNT}/.bootlog"
+    #Fix the time and hostname
+    BTIMESPEC=$(echo `date +"%b %d %T"` `hostname`)
+    sed -i "s@^bootlog:@${BTIMESPEC} bootlog:@" "${TEMPFS_MOUNT}/.bootlog"
+    cat "${TEMPFS_MOUNT}/.bootlog" >> /var/log/boot.log
+    rm -f "${TEMPFS_MOUNT}/.bootlog"
+fi
+
+# End $RC_BASE/init.d/rc
