SourceForge.net Logo

B.10. /etc/rc.d/rc.sysinit

#!/bin/ash
# 
# GPL $Id: rc.sysinit,v 1.2 2005/10/09 16:39:05 cvonk Exp $
# system init script

# dump the kernel ring buffer so we can examine it later
dmesg > /var/log/messages

echo "`basename $0` running .."
( mkdir -p /proc /boot /sys
  mount -a
  echo 1 > /proc/sys/kernel/printk  # log level on boot
  echo 0 > /proc/sys/kernel/sysrq ) 2>&1 2> /dev/null >> /var/log/messages

# start the subsystems
#  LED2 = all subsystems running
#  RESET switch = when pressed during boot, return to default config
FAIL=0
for ii in /etc/rc3.d/S* ; do
    SERVICENAME=${ii#/etc/rc3.d/S??}
    echo -n "Starting $SERVICENAME .."
    if [ -f /etc/sysconfig/$SERVICENAME.conf ] ||
       [ -d /etc/sysconfig/$SERVICENAME ] ; then
	if $ii start ; then
	    echo ""
	else
	    echo " [FAIL]"
	    FAIL=1
	fi
    else
	echo " [NO_CONF]"
    fi
done

if [ -c /dev/gpio-led2 ] ; then
    echo $FAIL > /dev/gpio-led2
fi

if [ -c /dev/gpio-reset ] ; then
    echo > /dev/null
    # should use dd to take 1 char from this dev, and see if we have to
    # default to a 'safe' configuration  
fi

sleep 1
# 

Example B.10. /etc/rc.d/rc.sysinit