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