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