Changeset 1d02f01 in bootscripts-standard


Ignore:
Timestamp:
Oct 23, 2007, 1:07:58 AM (17 years ago)
Author:
Jim Gifford <clfs@…>
Branches:
master
Children:
1680407
Parents:
d8a3177
Message:

Merged Updates from BLFS/LFS SVNs

Files:
1 added
14 edited

Legend:

Unmodified
Added
Removed
  • Changelog

    rd8a3177 r1d02f01  
     1jim - October 23, 2007
     2        * Merged BLFS changes from SVN
     3        * Merged LFS changes from SVN
     4
    15jim - October 16, 2007
    26        * Merged BLFS scripts
  • Makefile

    rd8a3177 r1d02f01  
    6060        install -m ${MODE} clfs/init.d/halt          ${EXTDIR}/rc.d/init.d/
    6161        install -m ${MODE} clfs/init.d/console       ${EXTDIR}/rc.d/init.d/
     62        install -m ${MODE} clfs/init.d/consolelog    ${EXTDIR}/rc.d/init.d/
    6263        install -m ${MODE} clfs/init.d/localnet      ${EXTDIR}/rc.d/init.d/
    6364        install -m ${MODE} clfs/init.d/modules       ${EXTDIR}/rc.d/init.d/
     
    99100        ln -sf ../init.d/reboot      ${EXTDIR}/rc.d/rc6.d/S99reboot
    100101        ln -sf ../init.d/mountkernfs ${EXTDIR}/rc.d/rcsysinit.d/S00mountkernfs
     102        ln -sf ../init.d/consolelog  ${EXTDIR}/rc.d/rcsysinit.d/S02consolelog
    101103        ln -sf ../init.d/modules     ${EXTDIR}/rc.d/rcsysinit.d/S05modules
    102         ln -sf ../init.d/udev        ${EXTDIR}/rc.d/rcsysinit.d/S10udev
     104        ln -sf ../init.d/udev        ${EXTDIR}/rc.d/rcsysinit.d/S100udev
    103105        ln -sf ../init.d/checkfs     ${EXTDIR}/rc.d/rcsysinit.d/S20checkfs
     106        ln -sf ../init.d/setclock    ${EXTDIR}/rc.d/rcsysinit.d/S25setclock
    104107        ln -sf ../init.d/mountfs     ${EXTDIR}/rc.d/rcsysinit.d/S30mountfs
    105108        ln -sf ../init.d/swap        ${EXTDIR}/rc.d/rcsysinit.d/S40swap
    106109        ln -sf ../init.d/cleanfs     ${EXTDIR}/rc.d/rcsysinit.d/S50cleanfs
    107         ln -sf ../init.d/setclock    ${EXTDIR}/rc.d/rcsysinit.d/S60setclock
    108110        ln -sf ../init.d/console     ${EXTDIR}/rc.d/rcsysinit.d/S70console
    109111        ln -sf ../init.d/localnet    ${EXTDIR}/rc.d/rcsysinit.d/S80localnet
     
    119121        install                   -m ${MODE} clfs/sysconfig/network-devices/services/ipv4-static-route ${EXTDIR}/sysconfig/network-devices/services/
    120122        @$(MAKE) mknod_devices
    121 
    122 install-consolelog: create-dirs
    123         install -m ${MODE} contrib/init.d/consolelog   ${EXTDIR}/rc.d/init.d
    124         ln -sf ../init.d/consolelog  ${EXTDIR}/rc.d/rcsysinit.d/S00consolelog
    125         install --backup=numbered -m ${CONFMODE} contrib/sysconfig/consolelog  ${EXTDIR}/sysconfig/
    126123
    127124install-service-mtu: create-service-dir
     
    10061003.PHONY: all create-dirs create-service-dir \
    10071004        install \
    1008         install-consolelog \
    10091005        install-service-mtu \
    10101006        minimal \
  • cblfs/sysconfig/network-devices/services/dhclient

    rd8a3177 r1d02f01  
    1616{
    1717        # Print the last 16 lines of dhclient.leases
    18         sed -e :a -e '$q;N;17,$D;ba' /var/state/dhcp//dhclient.leases
     18        sed -e :a -e '$q;N;17,$D;ba' /var/state/dhcp/dhclient.leases
    1919}
    2020
     
    6767        down)
    6868                boot_mesg "Stoping dhclient on the $1 interface..."
    69                 if [ "$DHCP_STOP" = "" ]
    70                 then
     69                if [ "$DHCP_STOP" = "" ]; then
    7170                        # This breaks multiple interfaces please provide
    7271                        # the correct stop arguments.
  • cblfs/sysconfig/network-devices/services/dhcpcd

    rd8a3177 r1d02f01  
    66# Adapted for dhcpcd by DJ Lucas <dj@lucasit.com>
    77
    8 #$LastChangedBy: dj $
    9 #$Date: 2007-08-21 23:09:21 -0500 (Tue, 21 Aug 2007) $
     8#$LastChangedBy$
     9#$Date$
    1010
    1111. /etc/sysconfig/rc
     
    1313. $IFCONFIG
    1414
    15 PIDFILE="/var/run/dhcpcd-$1.pid"
    16 LEASEINFO="/var/lib/dhcpcd/dhcpcd-$1.info"
     15pidfile="/var/run/dhcpcd-$1.pid"
     16leaseinfo="/var/lib/dhcpcd/dhcpcd-$1.info"
    1717
    1818case "$2" in
     
    2020                boot_mesg -n "Starting dhcpcd on the $1 interface..."
    2121                # Test to see if there is a stale pid file
    22                 if [ -f "$PIDFILE" ]
    23                 then
    24                         ps `cat "$PIDFILE"` | grep dhcpcd > /dev/null
    25                         if [ $? != 0 ]
    26                         then
    27                                 rm -f $PIDFILE > /dev/null
     22                if [ -f "$pidfile" ]; then
     23                        ps `cat "$pidfile"` | grep dhcpcd > /dev/null
     24                        if [ $? != 0 ]; then
     25                                rm -f $pidfile > /dev/null
    2826                        else
    2927                                boot_mesg "dhcpcd already running!" ${WARNING}
     
    3735                # Print the assigned settings if requested
    3836                if [ "$RET" = "0" -a "$PRINTIP" = "yes" ]; then
    39                         . $LEASEINFO
     37                        . $leaseinfo
    4038                        if [ "$PRINTALL" = "yes" ]; then
    4139                                echo ""
     
    6462        down)
    6563                boot_mesg -n "Stopping dhcpcd on the $1 interface..."
    66                 if [ -z "$DHCP_STOP" ]
    67                 then
     64                if [ -z "$DHCP_STOP" ]; then
    6865                        echo ""
    69                         killproc -p "$PIDFILE" /sbin/dhcpcd
     66                        killproc -p "$pidfile" /sbin/dhcpcd
    7067                else
    7168                        /sbin/dhcpcd $1 $DHCP_STOP &> /dev/null
     
    9188
    9289# End $network_devices/services/dhcpcd
     90
  • clfs/init.d/checkfs

    rd8a3177 r1d02f01  
    6767                # Note: -a option used to be -p; but this fails e.g.
    6868                # on fsck.minix
    69                 fsck ${options} -a -A -C -T 2>/dev/null
     69                fsck ${options} -a -A -C -T
    7070                error_value=${?}
    7171
  • clfs/init.d/functions

    rd8a3177 r1d02f01  
    5151WCOL=$((${COL} - 2))
    5252
    53 ## Set Cursor Position Commands, used via echo -e
     53## Provide an echo that supports -e and -n
     54# If formatting is needed, $ECHO should be used
     55case "`echo -e -n test`" in
     56        -[en]*)
     57                ECHO=/bin/echo
     58                ;;
     59        *)
     60                ECHO=echo
     61                ;;
     62esac
     63
     64## Set Cursor Position Commands, used via $ECHO
    5465SET_COL="\\033[${COL}G"      # at the $COL char
    5566SET_WCOL="\\033[${WCOL}G"    # at the $WCOL char
    5667CURS_UP="\\033[1A\\033[0G"   # Up one line, at the 0'th char
    5768
    58 ## Set color commands, used via echo -e
     69## Set color commands, used via $ECHO
    5970# Please consult `man console_codes for more information
    6071# under the "ECMA-48 Set Graphics Rendition" section
     
    115126
    116127        ## Figure out the length of what is to be printed to be used
    117         ## for warning messges.
    118         STRING_LENGTH="`echo "${1}" | sed \
    119                 -e 's,.,.,g' -e 'l 1' | grep -c \$`"
     128        ## for warning messages.
     129        STRING_LENGTH=$((${#1} + 1))
    120130
    121131        # Print the message to the screen
    122         echo ${ECHOPARM} -e "${2}${1}"
    123         if [ "$LOGGING" ]; then
    124                 DISPLAYLOG="${1}"
    125         fi
     132        ${ECHO} ${ECHOPARM} -e "${2}${1}"
    126133       
    127134}
     
    147154echo_ok()
    148155{
    149         echo -n -e "${CURS_UP}${SET_COL}${BRACKET}[${SUCCESS}  OK  ${BRACKET}]"
    150         echo -e "${NORMAL}"
    151         boot_mesg_flush "[  OK  ]"
    152156        if [ "$LCD_PROG" ]; then
    153157                if [ "$LCD_LINES" = "2" ]; then
     
    157161                        LCD_OUT2="${LCD_OUT1:0:12} OK"
    158162                        $LCD_PROG "$LCD_OUT2" > /dev/null 2>&1
    159                 fi                     
    160         fi
     163                fi
     164        fi
     165        ${ECHO} -n -e "${CURS_UP}${SET_COL}${BRACKET}[${SUCCESS}  OK  ${BRACKET}]"
     166        ${ECHO} -e "${NORMAL}"
     167        boot_mesg_flush
    161168}
    162169
    163170echo_failure()
    164171{
    165         echo -n -e "${CURS_UP}${SET_COL}${BRACKET}[${FAILURE} FAIL ${BRACKET}]"
    166         echo -e "${NORMAL}"
    167         boot_mesg_flush "[ FAIL ]"
    168172        if [ "$LCD_PROG" ]; then
    169173                if [ "$LCD_LINES" = "2" ]; then
     
    175179                fi
    176180        fi
     181        ${ECHO} -n -e "${CURS_UP}${SET_COL}${BRACKET}[${FAILURE} FAIL ${BRACKET}]"
     182        ${ECHO} -e "${NORMAL}"
     183        boot_mesg_flush
    177184}
    178185
    179186echo_warning()
    180187{
    181         echo -n -e "${CURS_UP}${SET_COL}${BRACKET}[${WARNING} WARN ${BRACKET}]"
    182         echo -e "${NORMAL}"
    183188        if [ "$LCD_PROG" ]; then
    184189                if [ "$LCD_LINES" = "2" ]; then
     
    188193                        LCD_OUT2="${LCD_OUT1:0:10} WARN"
    189194                        $LCD_PROG "$LCD_OUT2" > /dev/null 2>&1
    190                 fi                     
    191         fi
    192         boot_mesg_flush "[ WARN ]"
     195                fi
     196        fi
     197        ${ECHO} -n -e "${CURS_UP}${SET_COL}${BRACKET}[${WARNING} WARN ${BRACKET}]"
     198        ${ECHO} -e "${NORMAL}"
     199        boot_mesg_flush
    193200}
    194201
     
    198205        # $i is inherited by the rc script
    199206        boot_log "\n\n${i} failed and exited with a return value of ${error_value}."
    200         boot_mesg_flush
    201207        boot_mesg -n "FAILURE:\n\nYou should not be reading this error message.\n\n" ${FAILURE}
    202208        boot_mesg -n " It means that an unforeseen error took"
     
    209215        boot_mesg " clfs-dev@cross-lfs.org.\n"
    210216        boot_mesg_flush
    211         if [ "$INTERACTIVE" ]; then
    212                 boot_mesg -n "Press Enter to continue..." ${INFO}
    213                 boot_mesg "" ${NORMAL}
    214                 if [ "$LCD_PROG" ]; then
    215                         sleep 10
    216                 else
    217                         read ENTER
    218                 fi
    219         fi
     217        boot_mesg -n "Press Enter to continue..." ${INFO}
     218        boot_mesg "" ${NORMAL}
     219        read ENTER
    220220}
    221221
     
    258258        fi
    259259
    260 #       boot_mesg_flush
    261 #       echo_warning
    262 
    263260        case "${1}" in
    264261
     
    272269                        case "${2}" in
    273270                                running)
    274                                         echo -e -n "${CURS_UP}"
    275                                         echo -e -n "\\033[${STRING_LENGTH}G   "
     271                                        ${ECHO} -e -n "${CURS_UP}"
     272                                        ${ECHO} -e -n "\\033[${STRING_LENGTH}G   "
    276273                                        boot_mesg "Already running." ${WARNING}
    277274                                        echo_warning
    278275                                        ;;
    279276                                not_running)
    280                                         echo -e -n "${CURS_UP}"
    281                                         echo -e -n "\\033[${STRING_LENGTH}G   "
     277                                        ${ECHO} -e -n "${CURS_UP}"
     278                                        ${ECHO} -e -n "\\033[${STRING_LENGTH}G   "
    282279                                        boot_mesg "Not running." ${WARNING}
    283280                                        echo_warning
    284281                                        ;;
    285282                                not_available)
    286                                         echo -e -n "${CURS_UP}"
    287                                         echo -e -n "\\033[${STRING_LENGTH}G   "
     283                                        ${ECHO} -e -n "${CURS_UP}"
     284                                        ${ECHO} -e -n "\\033[${STRING_LENGTH}G   "
    288285                                        boot_mesg "Not available." ${WARNING}
    289286                                        echo_warning
     
    307304reloadproc()
    308305{
    309         if [ "${#}" = "0" ]; then
    310                 echo "Usage: reloadproc [{program}]"
    311                 exit 1
    312         fi
    313 
    314         getpids "${1}"
     306        local pidfile=""
     307        local failure=0
     308
     309        while true
     310        do
     311                case "${1}" in
     312                        -p)
     313                                pidfile="${2}"
     314                                shift 2
     315                                ;;
     316                        -*)
     317                                log_failure_msg "Unknown Option: ${1}"
     318                                return 2
     319                                ;;
     320                        *)
     321                                break
     322                                ;;
     323                esac
     324        done
     325
     326        if [ "${#}" -lt "1" ]; then
     327                log_failure_msg "Usage: reloadproc [-p pidfile] pathname"
     328                return 2
     329        fi
     330
     331        # This will ensure compatibility with previous CLFS Bootscripts
     332        if [ -n "${PIDFILE}" ]; then
     333                pidfile="${PIDFILE}"
     334        fi
     335
     336        # Is the process running?
     337        if [ -z "${pidfile}" ]; then
     338                pidofproc -s "${1}"
     339        else
     340                pidofproc -s -p "${pidfile}" "${1}"
     341        fi
    315342
    316343        if [ -n "${pidlist}" ]; then
    317                 failure="0"
    318344                for pid in ${pidlist}
    319345                do
     
    332358statusproc()
    333359{
    334         if [ "${#}" = "0" ]
    335         then
    336                 echo "Usage: statusproc {program}"
    337                 exit 1
    338         fi
    339 
    340         getpids "${1}"
     360        local pidfile=""
     361        local base=""
     362        local ret=""
     363
     364        while true
     365        do
     366                case "${1}" in
     367                        -p)
     368                                pidfile="${2}"
     369                                shift 2
     370                                ;;
     371                        -*)
     372                                log_failure_msg "Unknown Option: ${1}"
     373                                return 2
     374                                ;;
     375                        *)
     376                                break
     377                                ;;
     378                esac
     379        done
     380
     381        if [ "${#}" != "1" ]; then
     382                shift 1
     383                log_failure_msg "Usage: statusproc [-p pidfile] pathname"
     384                return 2
     385        fi
     386
     387        # Get the process basename
     388        base="${1##*/}"
     389
     390        # This will ensure compatibility with previous CLFS Bootscripts
     391        if [ -n "${PIDFILE}" ]; then
     392                pidfile="${PIDFILE}"
     393        fi
     394
     395        # Is the process running?
     396        if [ -z "${pidfile}" ]; then
     397                pidofproc -s "${1}"
     398        else
     399                pidofproc -s -p "${pidfile}" "${1}"
     400        fi
     401
     402        # Store the return status
     403        ret=$?
    341404
    342405        if [ -n "${pidlist}" ]; then
    343                 echo -e "${INFO}${base} is running with Process"\
     406                ${ECHO} -e "${INFO}${base} is running with Process"\
    344407                        "ID(s) ${pidlist}.${NORMAL}"
    345408        else
    346409                if [ -n "${base}" -a -e "/var/run/${base}.pid" ]; then
    347                         echo -e "${WARNING}${1} is not running but"\
     410                        ${ECHO} -e "${WARNING}${1} is not running but"\
    348411                                "/var/run/${base}.pid exists.${NORMAL}"
    349412                else
    350                         if [ -n "${PIDFILE}" -a -e "${PIDFILE}" ]; then
    351                                 echo -e "${WARNING}${1} is not running"\
    352                                         "but ${PIDFILE} exists.${NORMAL}"
     413                        if [ -n "${pidfile}" -a -e "${pidfile}" ]; then
     414                                ${ECHO} -e "${WARNING}${1} is not running"\
     415                                        "but ${pidfile} exists.${NORMAL}"
    353416                        else
    354                                 echo -e "${INFO}${1} is not running.${NORMAL}"
     417                                ${ECHO} -e "${INFO}${1} is not running.${NORMAL}"
    355418                        fi
    356419                fi
    357420        fi
     421
     422        # Return the status from pidofproc
     423        return $ret
    358424}
    359425
     
    426492                do
    427493                        if [ "${pid}" -ne "$$" -a "${pid}" -ne "${PPID}" ]; then
    428                                 kill -0 "${pid}" > /dev/null &&
     494                                kill -0 "${pid}" 2>/dev/null &&
    429495                                pidlist="${pidlist} ${pid}"
    430496                        fi
    431497                       
    432                         if [ "${silent}" -ne "1" ]; then
     498                        if [ "${silent}" != "1" ]; then
    433499                                echo "${pidlist}"
    434500                        fi
     
    443509        else
    444510                pidlist=`pidof -o $$ -o $PPID -x "$1"`
    445                 if [ "x${silent}" != "x1" ]; then
     511                if [ "${silent}" != "1" ]; then
    446512                        echo "${pidlist}"
    447513                fi
     
    592658{
    593659        local pidfile=""
    594         local killsig=""
     660        local killsig=TERM # default signal is SIGTERM
    595661        pidlist=""
    596662
    597 # This will ensure compatibility with previous CLFS Bootscripts
     663        # This will ensure compatibility with previous CLFS Bootscripts
    598664        if [ -n "${PIDFILE}" ]; then
    599665                pidfile="${PIDFILE}"
     
    610676                                log_failure_msg "Unknown Option: ${1}"
    611677                                return 2
    612                         ;;
     678                                ;;
    613679                        *)
    614680                                break
     
    625691        fi
    626692
     693        # Is the process running?
    627694        if [ -z "${pidfile}" ]; then
    628695                pidofproc -s "${1}"
     
    631698        fi
    632699
    633     # Change....
     700    # If running, send the signal
    634701    if [ -n "${pidlist}" ]; then
    635702        for pid in ${pidlist}
    636703        do
    637                 kill -${killsig:-TERM} ${pid} 2>/dev/null
    638                 if [ -z "${killsig}" ]; then
    639                         # Wait up to 3 seconds, for ${pid} to terminate
    640                         local dtime=${KILLDELAY}
     704                kill -${killsig} ${pid} 2>/dev/null
     705
     706                # Wait up to 3 seconds, for ${pid} to terminate
     707                case "${killsig}" in
     708                TERM|SIGTERM|KILL|SIGKILL)
     709                        # sleep in 1/10ths of seconds and
     710                        # multiply KILLDELAY by 10
     711                        local dtime="${KILLDELAY}0"
    641712                        while [ "${dtime}" != "0" ]
    642713                        do
    643714                                kill -0 ${pid} 2>/dev/null || break
    644                                 sleep 1
     715                                sleep 0.1
    645716                                dtime=$(( ${dtime} - 1))
    646717                        done
    647718                        # If ${pid} is still running, kill it
    648719                        kill -0 ${pid} 2>/dev/null && kill -KILL ${pid} 2>/dev/null
    649                 fi
     720                        ;;
     721                esac
    650722        done
    651723
    652         if [ -z "${killsig}" ]; then
    653                 pidofproc -s "${1}"
     724        # Check if the process is still running if we tried to stop it
     725        case "${killsig}" in
     726        TERM|SIGTERM|KILL|SIGKILL)
     727                if [ -z "${pidfile}" ]; then
     728                        pidofproc -s "${1}"
     729                else
     730                        pidofproc -s -p "${pidfile}" "${1}"
     731                fi
    654732
    655733                # Program was terminated
    656734                if [ "$?" != "0" ]; then
    657                         # Pidfile Exists
     735                        # Remove the pidfile if necessary
    658736                        if [ -f "${pidfile}" ]; then
    659737                                rm -f "${pidfile}"
     
    665743                        return 4 # Unknown Status
    666744                fi
    667         else
    668                 if [ -z "${pidfile}" ]; then
    669                         pidofproc -s "${1}"
    670                 else
    671                         pidofproc -s -p "${pidfile}" "${1}"
    672                 fi
    673         fi
    674 
    675         evaluate_retval # This is "Probably" not LSB compliant, but required to be compatible with older bootscripts
    676 
    677     else
     745                ;;
     746        *)
     747                # Just see if the kill returned successfully
     748                evaluate_retval
     749                ;;
     750        esac
     751    else # process not running
    678752        print_status warning not_running
    679753    fi
     
    697771log_success_msg()
    698772{
    699         echo -n -e "${BOOTMESG_PREFIX}${@}"
    700         echo -e "${SET_COL}""${BRACKET}""[""${SUCCESS}""  OK  ""${BRACKET}""]""${NORMAL}"
     773        ${ECHO} -n -e "${BOOTMESG_PREFIX}${@}"
     774        ${ECHO} -e "${SET_COL}""${BRACKET}""[""${SUCCESS}""  OK  ""${BRACKET}""]""${NORMAL}"
    701775        return 0
    702776}
     
    717791#*******************************************************************************
    718792log_failure_msg() {
    719         echo -n -e "${BOOTMESG_PREFIX}${@}"
    720         echo -e "${SET_COL}""${BRACKET}""[""${FAILURE}"" FAIL ""${BRACKET}""]""${NORMAL}"
     793        ${ECHO} -n -e "${BOOTMESG_PREFIX}${@}"
     794        ${ECHO} -e "${SET_COL}""${BRACKET}""[""${FAILURE}"" FAIL ""${BRACKET}""]""${NORMAL}"
    721795        return 0
    722796}
     
    737811#*******************************************************************************
    738812log_warning_msg() {
    739         echo -n -e "${BOOTMESG_PREFIX}${@}"
    740         echo -e "${SET_COL}""${BRACKET}""[""${WARNING}"" WARN ""${BRACKET}""]""${NORMAL}"
     813        ${ECHO} -n -e "${BOOTMESG_PREFIX}${@}"
     814        ${ECHO} -e "${SET_COL}""${BRACKET}""[""${WARNING}"" WARN ""${BRACKET}""]""${NORMAL}"
    741815        return 0
    742816}
  • clfs/init.d/localnet

    rd8a3177 r1d02f01  
    2020        start)
    2121                boot_mesg "Bringing up the loopback interface..."
     22                ip addr add 127.0.0.1/8 label lo dev lo
    2223                ip link set lo up
    2324                evaluate_retval
  • clfs/init.d/modules

    rd8a3177 r1d02f01  
    2222        start)
    2323
    24                 # If proc is mounted, find the current kernel
    25                 # message level
    26                 if [ -f /proc/sys/kernel/printk ]; then
    27                         prev_msg=`cat /proc/sys/kernel/printk | \
    28                                         sed 'l 1' | sed -n '2~0p' | \
    29                                         sed 's/\\\//'`
    30                 else
    31                         prev_msg="6"
    32                 fi
     24                # Exit if there's no modules file or there are no
     25                # valid entries
     26                [ -r /etc/sysconfig/modules ] &&
     27                        egrep -qv '^($|#)' /etc/sysconfig/modules ||
     28                        exit 0
    3329
    34                 # Now set the message level to 1 so not to make too
    35                 # much noise when loading modules
    36                 dmesg -n 1
     30                boot_mesg -n "Loading modules:" ${INFO}
    3731
    3832                # Only try to load modules if the user has actually given us
    3933                # some modules to load.
    40                 if egrep -qv '^(#|$)' /etc/sysconfig/modules 2>/dev/null
    41                 then
     34                while read module args; do
    4235
    43                         # Read in the configuration file.
    44                         exec 9>&0 < /etc/sysconfig/modules
     36                        # Ignore comments and blank lines.
     37                        case "$module" in
     38                                ""|"#"*) continue ;;
     39                        esac
    4540
    46                                 boot_mesg -n "Loading modules:" ${INFO}
     41                        # Attempt to load the module, making
     42                        # sure to pass any arguments provided.
     43                        modprobe ${module} ${args} >/dev/null
    4744
    48                                 while read module args
    49                                 do
    50                                         # Ignore comments and blank lines.
    51                                         case "${module}" in
    52                                                 ""|\#*) continue ;;
    53                                         esac
     45                        # Print the module name if successful,
     46                        # otherwise take note.
     47                        if [ $? -eq 0 ]; then
     48                                boot_mesg -n " ${module}" ${NORMAL}
     49                        else
     50                                failedmod="${failedmod} ${module}"
     51                        fi
     52                done < /etc/sysconfig/modules
    5453
    55                                         # Attempt to load the module, making
    56                                         # sure to pass any arguments provided.
    57                                         modprobe ${module} ${args} 2>&1 > /dev/null
     54                boot_mesg "" ${NORMAL}
     55                # Print a message about successfully loaded
     56                # modules on the correct line.
     57                echo_ok
    5858
    59                                         # Print the module name if successful,
    60                                         # otherwise take note.
    61                                         if [ ${?} -eq 0 ]; then
    62                                                 boot_mesg -n " ${module}" ${NORMAL}
    63                                         else
    64                                                 failedmod="${failedmod} ${module}"
    65                                         fi
    66                                 done
    67 
    68                                 boot_mesg "" ${NORMAL}
    69                                 # Print a message about successfully loaded
    70                                 # modules on the correct line.
    71                                 echo_ok
    72 
    73                                 # Print a failure message with a list of any
    74                                 # modules that may have failed to load.
    75                                 if [ "${failedmod}" ]; then
    76                                         boot_mesg "Failed to load modules:${failedmod}" ${FAILURE}
    77                                         echo_failure
    78                                 fi
    79 
    80                         exec 0>&9 9>&-
    81 
     59                # Print a failure message with a list of any
     60                # modules that may have failed to load.
     61                if [ -n "${failedmod}" ]; then
     62                        boot_mesg "Failed to load modules:${failedmod}" ${FAILURE}
     63                        echo_failure
    8264                fi
    83                 # Set the kernel message level back to it's previous value.
    84                 dmesg -n "${prev_msg}"
    8565                ;;
    8666        *)
  • clfs/init.d/mountfs

    rd8a3177 r1d02f01  
    1919        start)
    2020                boot_mesg "Remounting root file system in read-write mode..."
    21                 mount -n -o remount,rw / &>/dev/null
     21                mount -n -o remount,rw / >/dev/null
    2222                evaluate_retval
    2323
     
    3636                # their option list.  _netdev denotes a network filesystem.
    3737                boot_mesg "Mounting remaining file systems..."
    38                 mount -a -O no_netdev &>/dev/null
     38                mount -a -O no_netdev >/dev/null
    3939                evaluate_retval
    4040                ;;
     
    4242        stop)
    4343                boot_mesg "Unmounting all other currently mounted file systems..."
    44                 umount -a -d -r &>/dev/null
     44                umount -a -d -r >/dev/null
    4545                evaluate_retval
    4646                ;;
  • clfs/init.d/mountkernfs

    rd8a3177 r1d02f01  
    2020                boot_mesg -n "Mounting kernel-based file systems:" ${INFO}
    2121
    22                 if ! mountpoint /proc &> /dev/null; then
     22                if ! mountpoint /proc >/dev/null; then
    2323                        boot_mesg -n " /proc" ${NORMAL}
    2424                        mount -n /proc || failed=1
    2525                fi
    2626
    27                 if ! mountpoint /sys &> /dev/null; then
     27                if ! mountpoint /sys >/dev/null; then
    2828                        boot_mesg -n " /sys" ${NORMAL}
    2929                        mount -n /sys || failed=1
  • clfs/init.d/setclock

    rd8a3177 r1d02f01  
    3333        start)
    3434                boot_mesg "Setting system clock..."
    35                 hwclock --hctosys ${CLOCKPARAMS} &>/dev/null
     35                hwclock --hctosys ${CLOCKPARAMS} >/dev/null
    3636                evaluate_retval
    3737                ;;
     
    3939        stop)
    4040                boot_mesg "Setting hardware clock..."
    41                 hwclock --systohc ${CLOCKPARAMS} &>/dev/null
     41                hwclock --systohc ${CLOCKPARAMS} >/dev/null
    4242                evaluate_retval
    4343                ;;
    4444
    4545        *)
    46                 echo "Usage: ${0} {start}"
     46                echo "Usage: ${0} {start|stop}"
    4747                ;;
    4848
  • clfs/init.d/sysklogd

    rd8a3177 r1d02f01  
    3535        reload)
    3636                boot_mesg "Reloading system log daemon config file..."
    37                 reloadproc syslogd 1
     37                reloadproc syslogd
    3838                ;;
    3939
  • clfs/sysconfig/network-devices/services/ipv4-static

    rd8a3177 r1d02f01  
    4444fi
    4545
    46 if [ -n "${SOURCE}" ]; then
    47         args="${args} src ${SOURCE}"
    48 fi
    49 
    5046case "${2}" in
    5147        up)
    5248                boot_mesg "Adding IPv4 address ${IP} to the ${1} interface..."
    53                 if [ "${INTERFACE}" != "" ]; then
    54                         ip addr add ${args} dev ${1} label ${1}
    55                 else
    56                         ip addr add ${args} dev ${1}
    57                 fi
     49                ip addr add ${args} dev ${1}
    5850                evaluate_retval
    5951       
    60                 if [ "${INTERFACE}" = "" ]; then
    61                         if [ -n "${GATEWAY}" ]; then
    62                                 if ip route | grep -q default; then
    63                                         boot_mesg "Gateway already setup; skipping." ${WARNING}
    64                                         echo_warning
    65                                 else
    66                                         boot_mesg "Setting up default gateway..."
    67                                         ip route add default via ${GATEWAY} dev ${1}
    68                                         evaluate_retval
    69                                  fi
    70                         fi
     52                if [ -n "${GATEWAY}" ]; then
     53                        if ip route | grep -q default; then
     54                                boot_mesg "Gateway already setup; skipping." ${WARNING}
     55                                echo_warning
     56                        else
     57                                boot_mesg "Setting up default gateway..."
     58                                ip route add default via ${GATEWAY} dev ${1}
     59                                evaluate_retval
     60                         fi
    7161                fi
    7262        ;;
    7363       
    7464        down)
    75                 if [ "${INTERFACE}" = "" ]; then
    76                         boot_mesg "Removing Settings From ${1} interface..."
    77                         ip address flush dev ${1}
     65                if [ -n "${GATEWAY}" ]; then
     66                        boot_mesg "Removing default gateway..."
     67                        ip route del default
    7868                        evaluate_retval
    7969                fi
     70       
     71                boot_mesg "Removing IPv4 address ${IP} from the ${1} interface..."
     72                ip addr del ${args} dev ${1}
     73                evaluate_retval
    8074        ;;
    8175       
  • clfs/sysconfig/network-devices/services/ipv4-static-route

    rd8a3177 r1d02f01  
    7272fi
    7373
     74if [ -n "${SOURCE}" ]; then
     75        args="${args} src ${SOURCE}"
     76fi
     77
    7478case "${2}" in
    7579        up)
Note: See TracChangeset for help on using the changeset viewer.