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 /tmp /tmp
|
---|
10 | /bin/mkdir /dev/pts
|
---|
11 | /bin/mkdir /dev/shm
|
---|
12 | ln -s ../tmp /var/tmp
|
---|
13 |
|
---|
14 | /bin/echo "/sbin/mdev" > /proc/sys/kernel/hotplug
|
---|
15 |
|
---|
16 | echo -n "Starting mdev: "
|
---|
17 | /sbin/mdev -s
|
---|
18 | check_status
|
---|
19 |
|
---|
20 | echo -n "Mounting devpts: "
|
---|
21 | mount /dev/pts
|
---|
22 | check_status
|
---|
23 |
|
---|
24 | if [ -x /sbin/hwclock ] && [ -e /dev/rtc* ]; then
|
---|
25 | echo -n "Setting system clock: "
|
---|
26 | hwclock --hctosys --utc
|
---|
27 | check_status
|
---|
28 | fi
|
---|
29 |
|
---|
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
|
---|
47 |
|
---|
48 |
|
---|
49 | if [ -x /sbin/swapon ]; then
|
---|
50 | echo -n "Enabling swap space: "
|
---|
51 | swapon -a
|
---|
52 | check_status
|
---|
53 | fi
|
---|
54 |
|
---|
55 | echo -n "Remounting root rw: "
|
---|
56 | mount -o remount,rw /
|
---|
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 |
|
---|
80 | for i in /etc/rc.d/start/*
|
---|
81 | do
|
---|
82 | if [ -x $i ]; then
|
---|
83 | $i start
|
---|
84 | fi
|
---|
85 | done
|
---|
86 |
|
---|
87 | exit 0
|
---|