[a44b91b] | 1 | #!/bin/ash
|
---|
| 2 |
|
---|
| 3 | # System Startup Script
|
---|
| 4 | #
|
---|
| 5 |
|
---|
| 6 | PATH=/bin:/sbin:/usr/bin:/usr/sbin
|
---|
| 7 |
|
---|
| 8 | . /etc/rc.d/init.d/functions
|
---|
| 9 |
|
---|
| 10 | echo -n "Setting system clock: "
|
---|
| 11 | hwclock --hctosys --utc
|
---|
| 12 | check_status
|
---|
| 13 |
|
---|
| 14 | echo "Starting fsck for root filesystem."
|
---|
| 15 | fsck -T -C /
|
---|
| 16 | if [ "$?" -gt 2 ]; then
|
---|
| 17 | echo "WARNING: Errors found while checking root filesystem."
|
---|
| 18 | echo "You can login as root now, the system will reboot after logout."
|
---|
| 19 | sulogin
|
---|
| 20 | reboot
|
---|
| 21 | elif [ "$?" = "2" ]; then
|
---|
| 22 | echo "NOTICE: System needs to be rebooted now."
|
---|
| 23 | sleep 1
|
---|
| 24 | reboot
|
---|
| 25 | else
|
---|
| 26 | echo -n "Checking root filesystem: "
|
---|
| 27 | check_status
|
---|
| 28 | fi
|
---|
| 29 |
|
---|
| 30 | echo -n "Remounting root rw: "
|
---|
| 31 | mount -o remount,rw /
|
---|
| 32 | check_status
|
---|
| 33 |
|
---|
| 34 | echo -n "Mounting devpts: "
|
---|
| 35 | mount /dev/pts
|
---|
| 36 | check_status
|
---|
| 37 |
|
---|
| 38 | echo "Starting fsck for local filesystems."
|
---|
| 39 | fsck -A -C -R -T -t nonfs,nosmbfs
|
---|
| 40 | if [ "$?" -gt 2 ]; then
|
---|
| 41 | echo "WARNING: Errors found while checking filesystems."
|
---|
| 42 | echo "You can login as root now, the system will reboot after logout."
|
---|
| 43 | sulogin
|
---|
| 44 | reboot
|
---|
| 45 | elif [ "$?" = "2" ]; then
|
---|
| 46 | echo "NOTICE: System needs to be rebooted now."
|
---|
| 47 | sleep 1
|
---|
| 48 | reboot
|
---|
| 49 | else
|
---|
| 50 | echo -n "Checking local filesystems: "
|
---|
| 51 | check_status
|
---|
| 52 | fi
|
---|
| 53 |
|
---|
| 54 | echo -n "Enabling swap space: "
|
---|
| 55 | swapon -a
|
---|
| 56 | check_status
|
---|
| 57 |
|
---|
| 58 | echo -n "Setting hostname: "
|
---|
| 59 | hostname -F /etc/HOSTNAME
|
---|
| 60 | check_status
|
---|
| 61 |
|
---|
| 62 | echo -n "Cleaning up system: "
|
---|
| 63 | > /var/run/utmp
|
---|
| 64 | touch /var/log/wtmp
|
---|
| 65 | touch /var/log/messages
|
---|
| 66 | chmod 0664 /var/run/utmp
|
---|
| 67 | chmod 0664 /var/log/wtmp
|
---|
| 68 | chmod 0660 /var/log/messages
|
---|
| 69 | rm -rf /tmp/*
|
---|
| 70 | rm -f /var/run/*.pid
|
---|
| 71 | check_status
|
---|
| 72 |
|
---|
| 73 | echo -n "Setting up interface lo: "
|
---|
| 74 | ifconfig lo up 127.0.0.1
|
---|
| 75 | check_status
|
---|
| 76 |
|
---|
| 77 | echo "Running local start scripts."
|
---|
| 78 |
|
---|
| 79 | for i in /etc/rc.d/start/*
|
---|
| 80 | do
|
---|
| 81 | if [ -x $i ]; then
|
---|
| 82 | $i start
|
---|
| 83 | fi
|
---|
| 84 | done
|
---|