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