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