#! /bin/sh #---------------------------------------------------------------------------- # /etc/init.d/boot - initial boot script # # Creation: 08.08.2001 fm # Last Update: 14.09.2003 fm # # Copyright (c) 2001-2003 Frank Meyer # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- /usr/local/bin/colecho "Running $0" gn PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin; export PATH . /etc/config.d/base #---------------------------------------------------------------------------- # mount devices, e.g. /proc #---------------------------------------------------------------------------- cd / swapon -a /bin/mount -n -o remount,ro / 2>/dev/null if [ $? = 0 ] then echo "Checking file systems..." /sbin/fsck -A -p 2>/dev/null if [ $? -gt 1 ] then echo echo "fsck failed. Please repair manually and reboot. The root" echo "file system is currently mounted read-only. To remount it" echo "read-write do:" echo echo " bash# mount -n -o remount,rw /" echo echo "Attention: Only CONTROL-D will reboot the system in this" echo "maintanance mode. shutdown or reboot will not work." echo PS1="(repair filesystem) # " export PS1 /bin/sh /dev/console 2>&1 # if the user has mounted something rw, this should be umounted echo "Unmounting file systems (ignore error messages)" /bin/umount -avn # on umsdos fs this would lead to an error message. so direct # errors to /dev/null /bin/mount -no remount,ro / 2> /dev/null /bin/sync /sbin/reboot -f fi fi /bin/sync /bin/mount /proc 2>/dev/null # mount /proc /bin/mount -n -o remount,rw / # remount read-write rm -f /etc/mtab # remove old mtab cp /proc/mounts /etc/mtab # copy from /proc/mounts chmod 644 /etc/mtab # set permission /bin/mount -av 2>/dev/null # mount rest rm -f /var/run/*.pid 2>/dev/null rm -f /var/lock/*.pid 2>/dev/null rm -f /var/lock/samba/*.pid 2>/dev/null >/var/run/utmp /bin/hostname $HOSTNAME # set hostname