# /etc/rc - generic (to Linux) system startup file (runtime configuration)

echo "running /etc/rc..."

PATH=/sbin:/usr/bin:/bin; export PATH

if [ -f /fastboot ]
then
    echo Skipping fcsk
else
    fsck -AV -a
    # If there was a failure, drop into single-user mode.
    # NOTE: This is not secure.  If security is needed, make sure than
    #       /etc/securesinlge exists and "reboot single".  simipleinit
    #       will then prompt for root's password.
    if [ $? -gt 1 ]
    then
        echo "Warning: fsck FAILED"
        echo "         Starting single user shell"
        echo "         Fix filesystem and REBOOT"
        sh -si < /dev/console > /dev/console 2>&1
    fi
fi

# Remount the root filesystem in read-write mode
mount -n -o remount /dev/sda2 /

# update syncs the disk every 30 seconds
update &

# remove /etc/mtab* so mount creates the /etc/mtab file
rm -f /etc/mtab* /etc/nologin /fastboot

# mount all partitions specified in /etc/fstab
mount -av
# mount swap partition specified in /etc/fstab
# swapon -a

# tmp and usr may be mounted, so we do these rm's after mount
rm -f /usr/spool/uucp/LCK*
rm -rf /tmp; mkdir /tmp; chmod 777 /tmp

# remove /etc/utmp and touch it
rm -f /etc/utmp
touch /etc/utmp

# start up cron if it exists
if [ -f /etc/crond ]; then
	/etc/crond
fi

sh /etc/rc.local
