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